In a child theme, copy and edit the single_template_#.php that you’re using for your posts. (Note that for template 1, this is in loop-single-1.php instead.)
Near the top you will find a series of lines like this:
<div class="meta-info">
<?php echo $td_mod_single->get_category();?>
<?php //echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo $td_mod_single->get_commentsAndViews();?>
</div>
Try turning them into something like this:
<div class="meta-info">
<?php echo $td_mod_single->get_category();?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo get_avatar($post->post_author, '40');?>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_commentsAndViews();?>
</div>
Notes:
1. If you don’t have a child theme yet, you can test this in the theme editor by changing Newspaper’s own files, but make sure you backup the file
2. ’40’ is 40px, the width and height of the avatar image. Change to whatever you want
3. I haven’t tested the get_avatar function with an author ID — in the tagDiv files the parameter is the user email. If it doesn’t load the avatar, replace $post->post_author with get_user_by('id', $post->post_author)->user_email or something similar
4. You can style the avatar and user name to be right aligned by looking at the comments and views css and imitating that. Try echoing a <div> with a class like my_author_meta around those two echo statements, and then style that in the custom CSS panel
Just a thought and not tested. Let me know how it works.
Never mind about (1)! Got it working.
After digging a bit and getting an answer on the WP Stack Exchange I realized this has to do with child vs. descendant. I have it working 🙂
But it also required editing one part of td_css_generator.php. So I wanted to alert you guys to what I think is a bug in the theme. This CSS in td_css_generator:
.blog-stack .sf-menu .current-menu-item a,
.blog-stack .sf-menu .current-menu-parent .current-menu-item a,
.blog-stack .sf-menu .current-menu-parent > a,
.blog-stack .sf-menu > li:hover > a,
.blog-stack .sf-menu ul li:hover > a,
.blog-stack .td-post-text-content .more-link-wrap:hover a,
.blog-stack .sf-menu ul .td_mega_menu_sub_cats a.cur-sub-cat,
.blog-stack .sf-menu ul .td_mega_menu_sub_cats a.cur-sub-cat:hover,
.blog-stack .td-mega-menu .block-mega-child-cats a:hover,
.blog-stack .td_mod_mega_menu:hover .item-details a{
color:@link_color !important;
}
Should maybe have this for the first line?
.blog-stack .sf-menu .current-menu-item > a,
Because otherwise, even when I remove all my custom CSS for the menu, the dropdown from a current item has the same background colour and font colour. This was actually my first question on the support forum:
https://forum.tagdiv.com/topic/menu-dropdown-broken/
So yeah. If others have seen this problem, hope that helps!
(In the meantime… is there any way for me to overwrite td_css_generator with a child theme?)
Will just swing by for the ones I can answer quickly:
(2) If I understand you right: A child theme doesn’t store menu info (as in Appearance -> Menus); that’s in the MySQL database. I expect custom sidebars are the same but I’m not sure. I would probably just use a backup plugin if you have trouble finding your way around your database. If someone else has an easy way to backup just those settings, please share. :p
(3) A quick fix is to add this custom CSS in the theme panel:
.td_mod2 .meta-info {
display: none;
}
.td_mod2 {
margin-bottom: 10px;
}
Change the 10px to whatever spacing you want — default is around 40px.
(4) If they have featured images, best thing to do is clear your cache if you’re using one and follow these directions: https://forum.tagdiv.com/how-to-fix-strange-thumbnails/
(5) Align left with this custom CSS:
.td-social-wrap {
float: left;
}
For the other edits, you’d have to extensively edit td_social.php and td_social_icons.php, if those files can even be replaced in a child theme. You might want to just look at a plugin instead.
Looks like it will (and tested on my site). You can remove the line with “email” because that will remove the email field as well.
Note that the functions.php you’d want to add this to would be in a child theme so the fix can survive theme updates.
Not necessary to close in PHP-only files, I believe. The end you’re looking for is just the end of the file.
Hmm… that one is close, but makes the active text itself white, and using background-color instead of color gets us back where we started.
After trying to fiddle with this for a long time, and finding that there are so many classes involved that my just-learning knowledge of CSS is not enough, I made this quick screen capture to demonstrate what I mean.
This is using Lucian’s first CSS, which is actually the closest to what I want to see. That’s what I’ll leave on there for now.
Four things shown in the video:
(1) On Home page everything is fine. I wouldn’t want to lose any of that
(2) On test cat archive the two dropdown items are highlighted
(3) BUT on a post in test cat, the two dropdown items are not highlighted. This is exactly what (2) should look like
(4) Just showing a post in a subcat of test cat, which is also working correctly
So I feel like the styling is there already, but it’s a problem of making the parent cat archive not treat the subcats as active. Or if there is an extremely specific CSS class for subcat dropdown menu items whose parent is active, and which doesn’t break (4)…
Sorry to bother you so much! All your posts are really appreciated, but none of them have gotten those results so far 🙁 I might just live with this if I have to…
Not all post templates show the captions. (Style 2 does, style 4 doesn’t, haven’t played around with the others.)
I had this same need so I installed the plugin Advanced Custom Fields, added a metabox for photographers, and manually displayed the data saved there after the author. I found this a bit of a complicated process if you’ve never done anything like it and had to do a lot of reading. I can try to walk you through it if you want.
One easy way might be to try a plugin like Better Image Credits, which can take some credit fields and automatically output it at the top or bottom of your post, or other settings.
P.S. Oh, good point, I forgot that if you create a page template it can survive theme updates because it won’t be overwritten 🙂
Thanks for this CSS.
It would be great to have white background on:
(1) The page or category you’re on (Home, News, etc.)
(2) The category of the post or the you’re on (e.g. News for a news article)
(3) Parent category (e.g. Opinion when on Letter to the Editor: http://building.mediumutm.ca/opinion/letter-to-the-editor/ )
I can give up (3). (The original CSS from Lucian included it and the latest one doesn’t, but it doesn’t matter much to me either way.)
The only problem is that both groups of CSS also have this highlighting:
(4) The child categories of the parent category you’re on (e.g. all the dropdown items when on Opinion: http://building.mediumutm.ca/opinion/)
When this happens, hovering over the items in the dropdown has no visual response because they’re all selected, even though you’re only on the parent.
Is it possible to have the parent without the children?
(P.S. Will leave your CSS in for now so you can check)
-
This reply was modified 11 years by
TheMediumUTM.
Well, the sidebar is easy to remove under “page template settings” on the editing screen.
As for the header and footer, there are a few ways you could do this. Here are two:
1. You could edit the respective template files in a child theme to check the page id and only include the relevant elements if it’s not your thank you page.
For example, once you set up and activate a child theme, you could edit the header file you’ve selected in your theme panel. Find this in your-child-theme/parts/header… .php, and add this line before the first div:
<?php if (!is_page('4994')) { ?>
and this at the very end:
<?php } ?>
Your landing page id is the number that comes up when you hover over the link to edit the page: http://www.screencast.com/t/ANsTxW7C
Then you would do the same to other files you want to remove (menu-top.php, footer.php), save, upload, and clear cache.
2. If you’re not comfortable with child themes or php, you could instead do it quickly through CSS:
.page-id-4994 .td-header-bg {
display: none !important;
}
And add any container classes that you want to hide, putting them where .td-header-bg is, e.g. .td-header-menu-wrap. You can find these using inspect element.
The CSS solution isn’t great because all the content will still be downloaded by the client’s browser, but it’s very easy.
3. Create a custom page template. WordPress checks for page templates in a hierarchy of importance, including the slug and the ID, so if you your page’s slug is /email-landing and you have a template named page-email-landing.php, or page-4994.php, and so on, WordPress will use that rather than the default one. Then you could edit that one to suit your needs. You could copy page.php from the parent theme’s folder as a starting point.
From what I’ve read, this is probably the most natural solution, but it would still need a child theme to survive theme updates, and to be honest I haven’t looked at enough custom template building yet to know what to advise you. For example, you can’t just remove the call to get_header() from page.php or you’ll lose a lot more than the logo div, etc.
Those are my two cents, coming from a relatively new learner of this sort of thing. If anyone has a better solution, feel free to mention it so I can learn too. 🙂
I just tried that, and interestingly, it works for me in a child theme’s style.css but not in the custom CSS panel. If you add !important to any line, like this:
body {
font-size: 20px !important;
}
It should override what’s there. If not, it’s either conflicting with other !important tags or being overridden by more specific selectors. See if that works.
Note that you don’t have to specify lines that you aren’t overriding. E.g. I think the body font-family is PT Sans by default, so you don’t have to include that line.
Note also that this was recently asked here: https://forum.tagdiv.com/topic/font-changing-on-post-but-not-on-page/
Try .td-sub-footer-menu li a
Try doing inspect element on something that shows as blue. Even if it disappears after that initial load, browsers typically show you all css rules applying to an element and cross out the ones that have been overridden, like you see here:
http://www.screencast.com/t/lrkllbUBQV
Once you find out what’s styling the element, you can replace that too.
Welcome 🙂
Now that you have a child theme going you can edit the ad boxes too, in some file or other, but I haven’t looked at that myself, and @Lucian could probably cut down the time looking for where to add the conditions.
There is that “Disable comments sitewide” option in the theme panel. I haven’t used it and I’m not sure what it does on top of WordPress’s own (Settings -> Discussion -> Allow people to post comments on new articles), but it probably only affects the display of the comment section and not its functionality.
If you already have that theme setting turned off, check to make sure the WP setting allows comments. If both of them are right, the problem I think you’re noticing is that it doesn’t affect existing posts.
Each post also has the option to turn comments on or off individually. This is tedious, but you can speed it up by going to “all posts”, selecting them, and choosing “bulk edit” under the “bulk action” dropdown. After you apply that, the bottom right has a “comments” dropdown that you can set to “allow” or “do not allow”.
Does that help?
Thanks for the idea! I didn’t want to do it on a post-by-post basis (so. many. posts.) However, I couldn’t get it to style the way I wanted, either.
So this is what I did in the end:
1. Copied td_add_single_template_class to my functions.php, removed the filter for the parent function and added a filter for my child function
2. Updated the part of the function that puts in the default class, to first check for the case where the class is ‘single_template_4’ and !has_post_thumbnail(), and if so change the class to ‘single_template_2’ before adding it
3. Updated single_template_4.php, putting this conditional in:
if (in_array('single_template_4', get_body_class()))
4. Wrapped the entire remaining code in there, then added an else and copied the equivalent content from single_template_2.php and pasted it in the same way
It works! Needless to say, I’ve learned a lot about WordPress over the last two hours :p
TagDiv has said they don’t do custom work, but you can find a developer here: https://studio.envato.com/
Hi,
This was recently asked. Here you go: https://forum.tagdiv.com/topic/font-changing-on-post-but-not-on-page/
Edit: Oh, wait. I might not be getting you right. The above is for changing the font on pages. My apologies if that’s not what you mean.
-
This reply was modified 11 years by
TheMediumUTM.
Good to know!
In Newspaper/includes/modules/module_modifier/ you have td_module_blog.php. This is one of the files you can overwrite (at least I find) in a child theme, which you can set up here: https://forum.tagdiv.com/child-theme-documentation/
Once you have the child theme set up and activated, copy and paste that file into the corresponding folder in your child theme. Then edit the file.
The function get_author_box is the one you want to change.
Specifically, change these lines:
$buffy .= '<a href="' . get_author_posts_url($author_id) . '">' ;
$buffy .= get_avatar(get_the_author_meta('email', $author_id), '106');
$buffy .= '</a>';
to this one line:
$buffy .= get_avatar(get_the_author_meta('email', $author_id), '106');
and change this line:
$buffy .= '<a href="' . get_author_posts_url($author_id) . '">' . get_the_author_meta('display_name', $author_id) . '</a>' ;
to this:
$buffy .= get_the_author_meta('display_name', $author_id);
Save the file and upload via FTP. Clear cache and check the bottom of a post.
Hope this helps!
-
This reply was modified 11 years by
TheMediumUTM.
Indeed, I did (and cleared cache), but still no luck. This is what it looks like; is it right?
.blog-stack .sf-menu .current-menu-parent .current-menu-item a, .blog-stack .sf-menu .current-menu-parent > a, .blog-stack .sf-menu > li:hover > a, .blog-stack .sf-menu ul li:hover > a, .blog-stack .td-post-text-content .more-link-wrap:hover a, .blog-stack .sf-menu ul .td_mega_menu_sub_cats a.cur-sub-cat, .blog-stack .sf-menu ul .td_mega_menu_sub_cats a.cur-sub-cat:hover, .blog-stack .td-mega-menu .block-mega-child-cats a:hover, .blog-stack .td_mod_mega_menu:hover .item-details a {
color: #3daced !important;
background-color: #ffffff;
}
.blog-stack .sf-menu .current-menu-item a {
color: #ffffff !important;
background-color: inherit !important;
}
Thanks!
Hmm, didn’t work… disabled the highlighting altogether, except on the subcategory :p I’ll leave it like this for a bit so you can see: http://building.mediumutm.ca/opinion/
You can do this on a block-by-block basis by editing one in the visual composer, or on a site-wide basis by changing the WordPress Settings -> Reading -> Blog pages show at most … option.