- NewspaperChild Theme Support
- ApiThe Theme API
No, of course I’m talking about posts/articles assigned to only one category. And problem is not Category listing, but feature Next/Previous posts on Post view.
In your theme you could turn it on for whole web (Newspaper / Theme panel / Post settings / SHOW NEXT AND PREVIOUS POSTS – Show or hide next and previous posts (bottom of single post pages)
or put this element manually into Cloud Post Template (Add / Single Post shortcodes / Single Post Next Prev)
But in either case there are no setting options. And apparently your Theme uses default WP value, which is “same_category=false”, that means your theme will show Next/Prev posts just in date order, jumping from one category to another.
And my question is how to override such behaviour? Usually in profi templates is there always way through child theme functions.php, where you have to change same_category to true. But I don’t know how to do it in Newspaper theme – it depends on the code your programmers used.
Hello !
Yes, the best ideea would be to insert them in your functions.php in child theme. Please follow our tutorial here in order to learn how to set up child theme properly: https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thank you !
Hi, I generally had disabled Previous/Next post options for whole my Newspaper web, but on specific category I want to have such option – to allow visitors to continue reading story from one post to another one.
I guess there is no way how to set up such behavior via Newspaper theme panel so I have created Cloud Template Type “single” for these posts and in this template I added element “Single Post Next Prev“. BUT there is almost no customization options for element, only Color and CSS. And of course on post page it works the wrong way – it shows next/prev posts regardless category.
So my question is: how can I setup Previous/Next post feature in the same Category? I would accept even necessity of Child theme where will be modification for function get_previous_post $in_same_term = false=>true, but I don’t know, how exactly element “Single Post Next Prev“ uses this basic WP function and what precisely should be in functions.php
OK thank, I followed your advices https://forum.tagdiv.com/how-to-make-the-site-faster/
1. Enabling Gzip compression
2. Set the Leverage Browser Caching
It works but now I am following this tutorial https://speedrak.com/blog/how-to-move-javascripts-to-the-footer-in-wordpress/
I just have a question, I added this code `// Custom Scripting to Move JavaScript from the Head to the Footer
function remove_head_scripts() {
remove_action(‘wp_head’, ‘wp_print_scripts’);
remove_action(‘wp_head’, ‘wp_print_head_scripts’, 9);
remove_action(‘wp_head’, ‘wp_enqueue_scripts’, 1);
add_action(‘wp_footer’, ‘wp_print_scripts’, 5);
add_action(‘wp_footer’, ‘wp_enqueue_scripts’, 5);
add_action(‘wp_footer’, ‘wp_print_head_scripts’, 5);
}
add_action( ‘wp_enqueue_scripts’, ‘remove_head_scripts’ );
// END Custom Scripting to Move JavaScript`
in functions.php, but I have a child theme. Do I have to put this code in functions.php of my Child Theme ? or in Newspaper theme functions.php ? or Both ?
Thank you
Hello,
which is the recommended method for adding custom code in the functions.php? child theme?
i have to add some filters (cause of security), so it would be good if they arent gone after an update…
I installed the latest version yesterday. and everything is filled in.
but i got still:
Er moet een van ratingCount of reviewCount zijn opgegeven.
In english something like: an ratingcout or reviewcount must be set
https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fgadget-freakz.com%2Fproduct%2Fxiaomi-e-bike%2F
It looks like that error is coming from the Structured Data inserted by WooCommerce, not by WP Review Pro. To disable this feature in WooCommerce, I can add the following code to the functions.php file in my child theme (a tip from wp-review author):
add_action( ‘init’, ‘mts_remove_json_ld_frontend’ );
function mts_remove_json_ld_frontend() {
remove_action( ‘wp_footer’, array( WC()->structured_data, ‘output_structured_data’ ), 10 );
}
This should remove the “Product” Structured Data altogether, however, that might not be an ideal solution. It would be better to remove only the “Review” data from inside the “Product” data. You may need to consult with a developer on how to do that. Nevertheless, you can try the above code, just to verify that the issue is related to the WooCommerce Structured Data.
Can tagdiv help me please?
In back office this message also appears:
Notice: Use of undefined constant A13_TPL_SLUG – assumed ‘A13_TPL_SLUG’ in /home/clients/42376aae837f883480e00952ab1384a5/web/wp-content/themes/Newspaper-child/functions.php on line 43
Notice: Undefined index: post_ID in /home/clients/42376aae837f883480e00952ab1384a5/web/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-metabox.php on line 192
Notice: Undefined index: post_ID in /home/clients/42376aae837f883480e00952ab1384a5/web/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-metabox.php on line 192
Please I see this on my website : Notice: Use of undefined constant A13_TPL_SLUG – assumed ‘A13_TPL_SLUG’ in /home/clients/42376aae837f883480e00952ab1384a5/web/wp-content/themes/Newspaper-child/functions.php on line 43
At the footer page I also see : Notice: Constant WP_USE_THEMES already defined in /home/clients/42376aae837f883480e00952ab1384a5/web/index.php on line 14
The website is : https://www.digitalbusiness.africa/
Please, How could I solve it ? Thanks in advance!
Hi Calin,
I’m so sorry for my mistake. I just figured it out, yay! I was actually using a Newspaper Child theme and I had altered the functions.php file a while ago with some code from the Events Calendar knowledgebase about a problem I was having at the time. Thank you again for your help and so sorry for taking your time.
Thanks again,
Jennifer
Hi All
I purchased the theme and installed here http://infomyindia.com. It’s working fine but it’s resetting functions.php file permission to 00 (in both parent and child themes) https://www.screencast.com/t/aytWwjOhiN in 24 hours approx. I see, there is no malware in our server too. How can I fix this issue? Please help me to fix the issue.
Regards
Danish
Oh noooooo. That’s such a bummer. I have to use composer so I can have a couple of blocks in the left column next to the sidebar.
Is thee any way to get the pagination in a Child theme file override, or in a functions.php file override?
Thanks again.
Hello,
1. This problem appear after the last Chrome update, in order to fix it you’ll need to add in theme functions.php this custom code
add_action(
'admin_head',
function() {
echo '<style>.block-editor-writing-flow { height: auto; }</style>'; // phpcs:ignore
}
);
Paste the code here: https://www.screencast.com/t/kMKPrLsg7Tk
2. Please delete the only/actual child and set the child from the last package of Newspaper theme.
Also this problem can appear if you do not set all the files that need in child theme, please check our documentation for child theme here .
3. This can be a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.
Thank you!
Hello,
You can get the functions.php and footer.php from theme, but those are only the basic files, but you can get the files from wp-content/plugins/td-composer/legacy/Newspaper/parts/footer&header and set theme in child theme, also you can get more information from our guide .
Hope this will help you!
Thank you!
Thank you so much.
So when I want to add functions.php and footer.php files, where do I add them?
Child theme or root theme or composer/newspaper ?
Haha. Awesome. First I ask you and you give me a solution that does not work with your theme.
And then when you ask me to clarify you respond like that.
This should be a minor modification of the wp_enqueue_scripts in the child theme functions.php. And as the developers of the theme I thought you would be able to answer this easily.
But instead you ask me to get a developer to dig into how the theme works. Great thanks…
Hi
After some larger design updates I would like to force visitors to get the new theme css file by adding the child theme version as a query string to the css.
Today the child theme css looks like this in the head section:
https://i.imgur.com/oq65B4z.png
I have the following script in my child theme functions.php:
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’, 11);
function theme_enqueue_styles() {
wp_enqueue_style(‘td-theme’, get_template_directory_uri() . ‘/style.css’, ”, TD_THEME_VERSION, ‘all’ );
wp_enqueue_style(‘td-theme-child’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘td-theme’), TD_THEME_VERSION . ‘c’, ‘all’ );
}
How would I modify the wp_enqueue_scripts above to achieve that?
Hi,
This is not just a simple code, I think that will be better to set this code in functions.php and would be preferable to set it in a child theme, in this way you’ll not lose the code when you’ll make a theme update ( also make sure hat you have the last version of the theme, v9.7.4).
Child theme support https://forum.tagdiv.com/the-child-theme-support-tutorial/
Hope this will help you!
Thank you!
Hi,
We’ve tried to keep our documentation up to date for the child theme and for the rest of the theme functionality.
Since Newspaper v9.7 the theme functionality was moved in ta-composer and the child theme was working only with style.css and functions.php; but now in the last version ( Newspaper v9.7.4 ) the child theme is working again like before and the files from td-composer plugin can be set in the child theme -> https://forum.tagdiv.com/the-child-theme-support-tutorial/
We recommend to set the child theme via FTP, also if you are using the envato api, there can be a little delay until you’ll receive the available update.
Thank you for your understanding!
Hi,
Unfortunately, since Newspaper v9.7 the child theme is working only for the functions.php and style.css files.
Also make sure that there is Is no plugin conflict between the child and plugins.
We wrote an article on the subject here: https://tagdiv.com/updating-the-core-of-tagdiv-themes/
if you want and you need the child, you can try the implementation for the child theme provide by an user in this topic -> https://forum.tagdiv.com/topic/issue-with-9-7-update-changes-single_template_-in-child-theme/
Also there will be very soon an update that will make the child theme to work properly.
Thank you!
Hello @jbaldera,
You should insert this code on your functions.php on your child template:
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’, 11);
function theme_enqueue_styles() {
wp_enqueue_style(‘td-theme’, get_template_directory_uri() . ‘/style.css’, ”, TD_THEME_VERSION, ‘all’ );
wp_enqueue_style(‘td-theme-child’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘td-theme’), TD_THEME_VERSION . ‘c’, ‘all’ );
Hello !
The child theme was affected in the last updates due to the new reglementations of Envato:https://tagdiv.com/updating-the-core-of-tagdiv-themes/ The most important files from the child theme lately are style.css and functions.php, other modifications can be achieved using the theme panel.
Normally our child theme should remain the same after updates. But depends on the updates. 9.7 was a major update and that’s why there were so many issues with our users.
Yes, in the next update the child theme will be better optimized for Newspaper Theme.
I hope you understood our point of view and it’s clearer to you !
Thank you !
Is that specific for newspaper theme, because with other themes, when I create a child theme, inside I have style.css, functions.php and sometimes i create header.php and when I do a change inside function.php (child theme) it doesn’t effect it when I update the theme.
So in next update i should use child theme? for better customization.
Hi Calin,
To be honnest I’m very surprised by this situation. I’m using the child theme for many files :
– style.css
– editor-style.css
– functions.php
– special php page template
– other files
I don’t understand why you did not give any warning before ? It’s OK to decide to remove the child theme but please help us do the migration. Not like this without any help or heads up.
>> What are the next steps for your users with child theme ? We need to understand what to do now, not in 2 weeks.
Thanks for helping.
Hi,
Please note that child theme is not mandatory to be used in our theme. Most of the theme files were moved into the tagDiv Composer plugin as per the requirements of Envato: https://help.author.envato.com/hc/en-us/articles/360000472383-WordPress-Theme-Requirements. We wrote an article on the subject here: https://tagdiv.com/updating-the-core-of-tagdiv-themes/ Moving forward with such requirements, a child theme will only work with functions.php, and style.css, as there are very few files left in the main theme as Envato, requires all functionality to be added through plugins. For more information about installing the theme, please check here -> https://forum.tagdiv.com/install-via-ftp/ Also, for more information about child theme, please check here -> https://developer.wordpress.org/themes/advanced-topics/child-themes/
Thank you!
Hi,
Unfortunately there is no setting for this in our theme, this can be achieve only making change in theme core.
You could try this solution
-> https://www.screencast.com/t/nhov88jSu you need to set this code in each module where you want to have the subtitle with link on int to the post.
You can get the code from here ; but notice that you need to make those changes after each update, because since Newspaper v9.7 the child theme is working only for the functions.php and style.css files.
We wrote an article on the subject here: https://tagdiv.com/updating-the-core-of-tagdiv-themes/
Thank you for your understanding!