Home User profile
tagDiv Member
The Medium is the student newspaper of the University of Toronto Mississauga. We use tagDiv's excellent Newspaper theme, with some style and under-the-hood functionality customization.
TheMediumUTM
tagDiv Member

To be honest I found that the update didn’t fix it and I had to change the z-index of both elements. It might be affecting you too. I did this:

.sf-menu {
  z-index: 2 !important;
  }

.td_revolution_slider {
  z-index: 1 !important;
}
TheMediumUTM
tagDiv Member

Here are a few elements you can play around with the whitespace on:

.home .td_mod_wrap {
  margin-bottom: 0px;
}

.home .td_block_wrap {
  padding-bottom: 0px;
}

.home .wpb_row .row-fluid {
  margin-bottom: 10px !important;
}

Enter in Theme Panel -> Your Custom CSS and fiddle with the numbers till you’re happy.

TheMediumUTM
tagDiv Member

When I click the links on your big slider, they seem to go to the right posts. Do you still have the issue?

TheMediumUTM
tagDiv Member

That’s a good sign, it means it’s doing something. 😉

I just skimmed the code and the mistake is mine. I forgot a close quote on the new tab strings. Here it is fixed:

		// Set up your row, column, and tabs element
$to_echo = '[vc_row][vc_column width="1/1"][vc_tabs]';

// Simplest possible example of getting ACF data, sub in yours
$data_1 = get_field('2g_network');
$data_2 = get_field('3g_network');

// Repeat these lines for each tab, making sure each tab has a unique id
$to_echo .= '[vc_tab title="The first tab" tab_id="tab_1"]';
$to_echo .= $data_1;
$to_echo .= '[/vc_tab]';

$to_echo .= '[vc_tab title="The second tab" tab_id="tab_2"]';
$to_echo .= $data_2;
$to_echo .= '[/vc_tab]';

// (You could wrap each block in an if to skip a tab if the data is empty)

// When you have all your tabs, close the elements
$to_echo .= '[/vc_tabs][/vc_column][/vc_row]';

// We have to filter the whole string to make WP interpret the shortcodes
$to_echo = wpb_js_remove_wpautop($to_echo);

// Do whatever
echo $to_echo;
TheMediumUTM
tagDiv Member

It looks like you’ve done it almost exactly right. But I have these notes:

1. I made a mistake when I said to use the_field — change all instances to get_field in the code.

2. If you can’t activate a child theme, your code modifications won’t survive a theme update anyway and you’ll have to redo it each time you update. 🙁 Still, it should work. And it’s fine if you use that block of code instead of the functions.php way I quoted.

3. Once you have that code in your template files, you don’t need to do anything from the post editing page besides enter those custom fields.

4. If you’re not seeing anything show up when you view the post, you might be putting your code in the wrong single post template file. There are seven of those in this theme: loop-single.php, loop-single-1.php, single_template_2.php, single_template_3.php, single_template_4.php, and single_template_5.php. You could put the above code in whichever template file you’ve picked in Theme Panel -> Post Settings, or you could put it in every template file.

5. Just to make sure, where are you putting the code in the template file? (Which lines come right before and after it?)

TheMediumUTM
tagDiv Member

For problem 2, if you want, you can hack it out of the single template files. What you would do is first make sure you have a child theme set up and activated. (You could do this in the Newspaper them itself, but it would not survive a theme update. Then again, hopefully an update will allow you to disable categories via the panel.)

Then, for each of the following files in the Newspaper theme folder:

loop-single.php, loop-single-1.php, single_template_2.php, single_template_3.php, single_template_4.php, single_template_5.php

Copy and paste them into your child theme folder.

In each one, find the line:

<?php echo $td_mod_single->get_category();?>

and comment it out like this:

<?php // echo $td_mod_single->get_category();?>

Upload the files to your site. Your template files will no longer add the category element to your posts.

Happy editing and hope someone else stops by to help with the other problems!

TheMediumUTM
tagDiv Member

Great!

TheMediumUTM
tagDiv Member

Oh man! I’m really sorry about what option 1 did!! It might have been possible to undo that 🙁 I should probably give up trying to offer support after an oversight like that… Out of curiosity, what were the WordPress address and site address filled in with, and where is the WordPress install located in your website files?

Yeah, either Chris’s or my edit to the php line would work but Chris’s is easier to parse later if you change your URL one day. :p

TheMediumUTM
tagDiv Member

Hi Ecofame. I’m looking at your site and the CSS I gave you is in effect! The whitespace I was hoping to remove is gone — the space between each row in the blocks. (You may need to clear your cache, or if you’re using a CDN purge that cache, or hard refresh your browser cache… there are many potential reasons you might be seeing an old version of your page!) If there’s a different whitespace you want to remove, please point it out in a screenshot.

TheMediumUTM
tagDiv Member

Welcome!

TheMediumUTM
tagDiv Member

Try changing the site url in WordPress’s settings (“General” tab) to pitchforkmarketing.com/blog. This represents where the WP site is.

The target of that link is generated in whichever header file is associated with the style you’ve chosen in the theme panel (and located in wp-content/themes/Newspaper/parts/). The relevant code is <?php echo home_url(); ?>. If the first step fails to work, or for some reason you don’t want to change youur site url, you could create a child theme and change the line to <?php echo home_url() . '/blog'; ?>.

TheMediumUTM
tagDiv Member

Go to Theme Panel -> Custom CSS and paste it in there.

If it doesn’t work, add an !important tag like this:


.td_mod_wrap .meta-info {
  display: none !important;
}

Make sure to refresh your cache if you’re using a cache plugin. Let me know if that works!

As for site design, to each his own 🙂 I guess the more options the better.

TheMediumUTM
tagDiv Member

No problem. I’d love to help but prefer not to share contact info for the time being… Can you describe the steps you’re taking? Do you have a child theme set up and activated? Do you have FTP access to your site?

TheMediumUTM
tagDiv Member

The link I shared generates all the hard part of the CSS based on the gradient you make there. Once you make the gradient you want:

1. Go to your Theme Panel -> Custom CSS

2. Enter .td-menu-wrap { on a new line

3. Copy and paste all the CSS code generated by that site

4. Enter } on one more new line

5. Delete your cache if you use one and refresh page.

If this doesn’t work, the implementation will be more difficult and you’d probably have to wait for tagDiv support after the weekend.

Good luck!

TheMediumUTM
tagDiv Member

Check out “Post type” further down in the block settings 🙂

Use “page” even though the label suggests that you use “pages”.

Difficulty: Pages don’t have categories or tags and are hard to filter. Maybe you could assign the pages you want to show to a single author and the ones you don’t want to show to a different author, or change the pages’ publish dates to the most recent.

TheMediumUTM
tagDiv Member

^

But to be a little more in the spirit of the support forum… 😉

Theme panel -> Install demo. First button you see

TheMediumUTM
tagDiv Member

Ahhh! If whitespace is one extreme, aftonbladet.se is very much the opposite. :p

Ecofame: I’m not sure how you’re currently hiding your meta info, but it’s still taking up some space and that’s the reason your rows are taller than you want. Use this instead:


.td_mod_wrap .meta-info {
  display: none;
}
TheMediumUTM
tagDiv Member

P.S. Lucian, I finally installed the Live CSS Editor I see in your screenshots sometimes. So good 😀 Much better than fiddling with five different parts of the inspector or a stubborn cache…

TheMediumUTM
tagDiv Member

Lazy way to do them all at once is to use custom CSS:


.post .td-category {
  display: none !important;
}
TheMediumUTM
tagDiv Member

This looks like it might be very handy:

http://www.colorzilla.com/gradient-editor/

The element to style is td-menu-wrap, I believe (which seems to be the one that gets the colour you set in the theme panel).

TheMediumUTM
tagDiv Member

Agreed, when I’ve seen a white screen and it’s not a php error, I’ve often found it’s aggressive CSS minifying. Both those plugins should work, but make sure you disable minifying CSS, and then clear the page cache before looking at your site.

TheMediumUTM
tagDiv Member

Maybe we can try to solve it here first? I don’t mind posting complete code modifications. Where are you stuck?

TheMediumUTM
tagDiv Member

Seems okay on my site. Note that WP’s built-in search is poor and it can be hard to know why it thinks a post is related to a term 😉 But if you get the same posts on page 2 no matter what keyword you try, then there’s a problem… As Shashank said, site URL would be helpful, and don’t forget to try deactivating plugins one by one to see if any of them cause this behaviour.

TheMediumUTM
tagDiv Member

Note! I should have used get_field, not the_field, up there. the_field echoes it right away but get_field gives you the data so you can put it in a tab.

One last thing is that if you’re going to use this in all your templates, you should probably just go to your child theme’s functions.php and turn the code into a function. You have to pass the post ID to that function as well. It should look like this:


function my_custom_field_tabs($post_id) {
  // all the code I posted above, indented
 ...
}

Except that instead of echo $to_echo; you’ll have return $to_echo;, and instead of $data_1 = get_field('field_1');, you'll have$data_1 = get_field(‘field_1’, $post_id);`.

Then, wherever you want to insert the tabs in a template, you would just use this one line:


<?php echo my_custom_field_tabs($post->ID); ?>
TheMediumUTM
tagDiv Member

You’re welcome! Where you put it depends where you want it in the post. You could have it between header and content, after content, after footer, after comments… etc.

If you open up loop-single.php or loop-single-1.php you will easily see the blocks where the header, content, and footer parts are prepared and echoed. For loop-single-2 through loop-single-5 it’s a little more complicated because the header block is located in single_template_2.php through single_template_5.php instead.

Just throw this code between a <?php tag and a ?> tag into one of those handily titled blocks.

And if you’re not using one already, don’t forget that these files should be modified in a child theme so they will survive theme updates.

The tab ID is okay as it is. As far as I can tell, it just needs to be unique and have no spaces.

P.S. If you know some CSS you could also add classes to your $to_echo string around your content and style that in the Custom CSS section of the theme panel. Wrapping the tabs is probably going to mess with them a little, but the content inside the tabs can be styled freely.

Viewing 25 posts - 201 through 225 (of 349 total)