Thank you for your kind answer. I know html and css. I dont know how php works. Can you help me in more details. This is my child theme functions code
<?php
/* ----------------------------------------------------------------------------
WordPress booster framework - this is our theme framework - all the content and settings are there
It is not necessary to include it in the child theme only if you want to use the API
*/
if (!defined('TD_THEME_WP_BOOSTER')) {
include TEMPLATEPATH . '/includes/td_wordpres_booster.php';
}
Can you please tell me how it should be?
Regards
Always glad to help 🙂
I’ve been tweaking PageSpeed on a daily basis since we setup our new web server last December (or rather, I started last year on this topic, but then ran into needing new web server in order to run mod_pagespeed). We run a mix of both WordPress and old-school shtml sites, and so it’s been a challenge to optimize some things for both, especially on our main business website where we have 15 years of static content, wordpress ‘blog’ and then new area for content using wordpress, plus ecommerce area, all on one domain. Fun times! 🙂
I’m super happy with Newspaper, as the devs have been one of the *few* WP devs who understand that it’s not good anymore to have 12 js files and 5 css files linked from every page. One theme I looked at the other day “required” a child theme, and had 15+ js/css files, and one loaded from the child theme not the parent theme. Really nice theme, but very badly architected for modern PageSpeed.
So, in case I haven’t said so lately to Radu and co. BRAVO!!!!!!!!!!!!
-
This reply was modified 11 years by
simchris.
Hi,
Thanks @Christopher!
@SnakeEater
Unfortunately you can’t modify the td_authors.php file using the child theme, you will need to modify the parent theme, you can find here the files that can be changed via child theme: https://forum.tagdiv.com/child-theme-documentation/
Thanks
Hi,
I tried to update the td_authors.php in the child theme, but it is not working.
The only way it works is if I edit the file directly in the parent theme. Is there a way to fix this? I don’t like editing the original files.
Cheers!
You would copy just the code you need. Doubling the whole functions.php in parent and child themes tends to generate errors and give you a white screen of death.
But sadly it’s not quite that simple. The line you added is part of another function in the parent: td_load_css. To alter it, copy the whole function you’ve edited into your child theme’s functions.php. You’ll know it’s the end because you’ll see this line:
add_action('wp_enqueue_scripts', 'td_load_css');
Don’t include that.
Now rename your new copy like this:
function my_td_load_css {
...
Then you need to unhook the original function and hook your new one in by adding these lines after the function:
remove_action('wp_enqueue_scripts', 'td_load_css');
add_action('wp_enqueue_scripts', 'my_td_load_css')
Let me know if it doesn’t work!
-
This reply was modified 11 years by
TheMediumUTM.
I changed functions.php file for turkish letters (ş,ğ) problem with adding this
image
It is ok now.
I know that I have to copy funtions.php file to the child theme but there is already one in child theme folder. What will I do? replace it or copy code
Everything is fine. Thank you.
I had the exact same problem. If you’re willing to dig into child themes and a bit of PHP, I outlined my solution here:
https://forum.tagdiv.com/topic/single-4-without-featured-image/
(I’m happy to elaborate if you’re interested and need any more detail)
-
This reply was modified 11 years by
TheMediumUTM.
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.
Hi,
Glad you figured it out, thanks for reporting this, we will take a look and fix this in the next theme update.
Unfortunately you can’t modify the css generator file using child theme.
Sorry about this!
Thanks for the message!
-
This reply was modified 11 years by
Lucian.
Hi,
Sorry for the delay. Have you managed to find an answer for all your questions? Please let me know if you have any other theme related issues.
Thanks for the message
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?)
The solutions were already on forum. I searched. Thank you. Have a nice day
Thank you for your answer,
Module7 problem is not fixed. I used Regenerate Thumbnails plugin but it didnt work. By the way I didnt have existing content. I installed theme first then created posts.
and
How can I change the size of social icons as 48px?
I need help
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.
Hi tagDiv,
I’ve purchased your theme. It is great.
I have few questions:
1) How can I translate my posts like this – image1 only for posts. not for menu, sidebar etc. do you recommend a plugin?
2) Is there any way to back up sidebars, menus etc. After all customization I will back up child theme somewhere. Then for example If I delete sidebars mistakenly, I can use the back up. Is child theme back up enough for whole customization steps that I’ve done before?
3) I dont want to show module2 text. Title is enough.
and how can I change the space shown on the picture?
image2
4)I have a problem with module7. It does not show the images. I picked a featured image for all posts but no result.
image3
5) Socia Icons.
a) Is it possible to change icon size as 48px? 32 is small. 64 is too big.
b) How can I make them align left? not center as default.
c)Feedly is not on the icon list. Is there any way to add it?
Good luck with your sales.
Best Regards
Ali
Hi,
We will think about this, you can use child theme so that an theme update won’t affect your changes. https://forum.tagdiv.com/child-theme-documentation/
Thanks for the message
@JBH
Hi, looks like setting proper folder permissions on your site really helped to start 🙂
But, looking at your example post page you have a LOT of work to do.
most of your errors have nothing to do with the theme; so you’re going to want to address all that stuff first. Possibly find better solutions for what you’re doing with some of those external systems. Basically you’re loading too many things from external sites, which will lower your scores; more than 5 external things is bad for speed.
For example – this is crazy:
This page has 29 external Javascript scripts. Try combining them into one. This page has 13 external stylesheets. Try combining them into one. This page has 7 external background images. Try combining them with CSS sprites.
Note you can’t do much about the stuff you’re loading from other sites/servers, but you should
1) remove “versioning” — implement the .htaccess (if running Apache) and functions.php suggestions which I’ve posted, especially for the remove of the version tags. If running child theme you may need to put in child version; not sure on that.
2) optimize javascript delivery; use the td speed booster plugin to help with theme resources; but it won’t help with external stuff you’re loading
3) you cant do anything about the image dimensions of the things being loaded off external websites
4) prefer async – you’d have to hack whatever plugin you’re using for Facebook to load that as async
5) optimize images – be sure what you upload is already as small as possible; also use something like smushit or similar; possibly use my functions.php code for setting smaller default compression size for WordPress built in function (e.g., change from default 90 to 6); then do regenerate thumbnails — boom everything 20% smaller!
7) consistent URL errors coming from your “leadpages” stuff
8) vary encoding errors – coming mostly from leadpages
9) redirect issues – whatever you’re doing with Facebook and Google generating errors
10) bad request with favicon
(etc.)
I can easily make this. However, I try not to mess too much with a theme if I don’t need to, because of upgrades and such. Child them might work, but I saw so many had problems even then. Will take a look at the plugin 🙂
3.6 to 4 is simple; follow the manual upgrade option
https://forum.tagdiv.com/how-to-update-the-theme/
Be sure to update the plugins found in the themeforest “all items” download for the theme, in the plugins folder after theme files updated.
be sure to
First make BACKUP of your dbase, and any special files you’ve modified; turn off all caching, clear caches, clear cache on CDN if using one; turn off mod_pagespeed if using it.
1) switch to main theme, NOT the child theme if using one
2) turn off all plugins while doing update
upload theme files via FTP
3) turn on ONLY the plugins included with theme after upgrade of both theme and plugins
4) if sidebars disappear you can usually just go to appearance and resave them and then back
5) turn on any “extra” plugins
Hope that helps! 🙂
Hello,
There is a bug in that function from WP, is reported on their issue tracker, what you can do is to hide the numbers via CSS, use this CSS, add it in Theme panel -> Custom CSS
.post div.page-nav-post a:first-Child {
display:inline-block;
}
.post div.page-nav-post a:last-Child {
display:inline-block;
}
.post .page-nav-post a {
display:none;
}
.post .page-nav-post > span {
display:none;
}
Thanks for the message!
The child theme option seems promising, but it’s so complicated and I’ve never touched a thing like that before. :/
Why don’t don’t newspaper have such a template? It should be added.
I desperately need to add a clear landing page to my site in the next couple of days. :/
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.