No search results were found in Documentation!
The developers of the Real Simple SSL plugin recommend using this code within the functions.php:
function rsssl_exclude_http_url($html) {
//replace the https url back to http
$html = str_replace(‘data-href=”https://www.domain.com’, ‘data-href=”http://www.domain.com’, $html); return $html;
}
add_filter(“rsssl_fixer_output”,”rsssl_exclude_http_url”);
I added it to the functions.php of our child theme, but it isn’t working.
Hi.
I just downloaded the 7.8 update and i’ve got a question about the functions.php file in child theme.
It says “Newspaper V6.3+ Child theme” but my current version (before 7.8 update) says “Newspaper 7 Child theme”. And one of the last lines of code seems a bit different. Why and which version should I use ?
Thanks.
Hi,
I have created a child theme for a couple of small changes I need.
In the main folder I have the following files:
style.css
functions.php
Then I have created the following structure: includes/wp_booster
and added 2 files in wp_booster
td_module_single_base.php
td_module.php
But td_module.php is not loading. The change in that file is not showing. I know the code is working because I have tested the file directly in the main theme. When I replace my file with the original file there, it works right away. But when I put the file in the child theme, it is not working!
What am I missing here?
Cheers,
I am encountering a problem with the styles of our childtheme. We are using Newspaper 7 atm and we have loaded in the sample childtheme of the Newspaper. It is activated and fully working. I can add functions into the functions.php and they work just fine. As soon as I want to change some styles though nothing happens.
It seems that the theme is not taking the styles in.
As soon as I remove the function which is getting both styles, from parent and child, the child css is working but as you can imagine the other styles are not.
So it seems that there is a problem with your function which is merging the styles?
We did not change anything in there.
Any suggestions how to get the styles working?
Thank you, Catalin. I do fully understand how the mobile theme works, and it works great. My question was only related to whether I could preserve any changes I make to the mobile theme’s functions.php file following a theme update. Because there is a function I have created that needs to appear in posts displayed using both the “normal: and the mobile theme, I need to add that function to the mobile theme’s functions.php file. I was hoping to be able to use my child theme’s functions.php for that so my changes would not be overwritten after an update but given your response, I will just make sure to keep a backup of /mobile/functions.php so I can restore my mods after a theme update. Thanks!
Hi, I am using the mobile theme and it works great! I appreciate how you added a special block on the page admin to insert specific elements for the mobile pages. I am just curious about the functions.php file; I had to add a function to it so that my shortcode would work in posts displayed in the mobile theme, so I created newspaper-child/mobile/functions.php and added the code there, but it turns out I had to do it in newspaper/mobile/functions.php, which is fine except that your next update is going to wipe out my change. Is there a way to do this in the child theme so that my mods are retained following a theme update? Thanks for any guidance you can provide.
So basically I messed up everything on a pretty important site. I moving three files from a child theme to the actual theme, and accidentally ticked the functions.php file and copied that over as well. That gave me the white screen of death. I tried just inserting a blank new functions.php file, but that did not fix it.
I am wondering if I need a backup or if it is possible to insert some sort of stock functions.php file. Please answer asap 🙂
Hi,
I know that the theme API is not supported by the child theme but… Can you please tell me what do I need to load in the child-theme functions.php file so that I can get at least some basic support for td_config? At the moment I’m interested in adding new single post styles within the child theme’s structure (but not override the existing ones), just like you would for example use td_api_single_template::add(‘single_template_14’…
I can’t touch the main theme (td_config and so on) because I will lose everything at the next update.
I can handle the code, I just need some hints as to what should I do to be have td support within the child theme because I get “Class ‘td_api_single_template’ not found in ../child-theme/functions.php”. Should I create a new class to extend the main class td_config? What do I need to make it work properly?
Thank you!
Hi, recently after upgrade my PHP to 7.0.15 when i want to login to my wordpress dashboard it gives me this error.
Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /srv/users/serverpilot/apps/app-name/public/wp-content/themes/Newspaper-child/functions.php:60 Stack trace: #0 /srv/users/serverpilot/apps/app-name/public/wp-settings.php(423): include() #1 /srv/users/serverpilot/apps/app-name/public/wp-config.php(54): require_once(‘/srv/users/serv…’) #2 /srv/users/serverpilot/apps/app-name/public/wp-load.php(37): require_once(‘/srv/users/serv…’) #3 /srv/users/serverpilot/apps/app-name/public/wp-admin/admin.php(31): require_once(‘/srv/users/serv…’) #4 /srv/users/serverpilot/apps/app-name/public/wp-admin/index.php(10): require_once(‘/srv/users/serv…’) #5 {main} thrown in /srv/users/serverpilot/apps/app-name/public/wp-content/themes/Newspaper-child/functions.php on line 60
anyone had this issues ?
Bogdan, when trying to diagnose the issue, I overwrote the functions.php and style.css that was in my child theme with the newest versions from the code folder, so they are up to date.
OK, but even if you did not edit anything in the child theme. How old is it? When did you create it? Please always use the style.css and functions.php provided in the child theme in each version release. If you did not alter anything then there will be no consequence in deleting and using the child theme provided with the latest version of the theme: http://screencast.com/t/jZ8YLxL0
Thanks.
Hello,
You will be able to use the child theme but only if you update it and make the necessary adjustments for future updates. A child theme is never update proof. If you alter functions.php and style.css those are files that are constantly changed in each update. They will have to be adjusted and your modifications tested with the new version each time. Please test without the child theme. Disable it for testing and see if the problem goes away without it.
Thank you!
Thank you. My child theme only contains functions.php and style.css
functions.php
(<?php
/* ----------------------------------------------------------------------------
Newspaper 7 Child theme - Please do not use this child theme with older versions of Newspaper Theme
What can be overwritten via the child theme:
- everything from /parts folder
- all the loops (loop.php loop-single-1.php) etc
- the rest of the theme has to be modified via the theme api:
https://forum.tagdiv.com/the-theme-api/
*/
/* ----------------------------------------------------------------------------
add the parent style + style.css from this folder
*/
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1001);
function theme_enqueue_styles() {
wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.css', '', TD_THEME_VERSION . 'c' , 'all' );
wp_enqueue_style('td-theme-child', get_stylesheet_directory_uri() . '/style.css', array('td-theme'), TD_THEME_VERSION . 'c', 'all' );
}
That seems to have solved it.
Weird seeing as I didn’t have any custom styles defined in the child theme. I just created it with an empty stylesheet and created the functions.php as per the WordPress Codex documentation.
Thanks for your help, great theme by the way!
Michael
Simplificare
I’m adding a custom sorting option to the block/big grid code.
To add it to the drop down list in the editor, the option value needs to be added to the sort array in this section of td_config.php around line 11275. This file will not override in child theme so is there a way to use a hook in functions.php to just add this value?
static function get_map_filter_array ($group = ‘Filter’) {
array(
“param_name” => “sort”,
“type” => “dropdown”,
“value” => array (
‘- Latest -‘ => ”,
‘Oldest posts’ => ‘oldest_posts’,
‘Alphabetical A -> Z’ => ‘alphabetical_order’,
‘Popular (all time)’ => ‘popular’,
‘Popular (jetpack + stats module requiered) Does not work with other settings/pagination’ => ‘jetpack_popular_2’,
‘Popular (last 7 days) – theme counter (enable from panel)’ => ‘popular7’,
‘Featured’ => ‘featured’,
‘Highest rated (reviews)’ => ‘review_high’,
‘Random Posts’ => ‘random_posts’,
‘Random posts Today’ => ‘random_today’ ,
‘Random posts from last 7 Day’ => ‘random_7_day’ ,
‘On This Day’ => ‘on_this_day’,
‘Most Commented’ => ‘comment_count’
),
Thanks.
Hi, i see it: https://forum.tagdiv.com/topic/setting-up-child-theme/#post-139087
Yes, we need update also the child theme but it’s 3 files:
– functions.php
– screenshot.png
– style.css
What in detail need to be update?
Thanks!
When using a child theme, the file js_composer.min.css is being loaded AFTER the parent and child theme style sheets. The documentation for a child theme adds the style sheets in functions.php using the function:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1000);
However, when this loads the child theme, the js_composer.min.css file is loaded after the parent and child style sheets. Is this a bug or was it intentional?
If the priority above is changed to 1001, which matches the priority from the file td_wp_booster_functions.php (below), the style sheets are loaded in the correct order.
td_wp_booster_functions.php:
/* ----------------------------------------------------------------------------
* front end css files
*/
add_action('wp_enqueue_scripts', 'load_front_css', 1001); // 1001 priority because visual composer uses 1000
Hi, I didn’t ask for any optimization or customization. I just wrote whatever i faced while playing with this theme, also this is the first time i use this theme.
You have written ‘If you want to always enable speed booster, delete this code from speed booster file: http://screencast.com/t/RZLIOPUNdqh’, does it work as it should after removing this code?.
If i want to add some code as said by Alin before ‘ https://forum.tagdiv.com/topic/search-box-3/’, should i add it to end of the functions.php?. ( forget about child theme )
Thanks.
Thanks again.
If i am not wrong, should i add the code to the end of the functions.php.
Any guide on how to create a ‘child theme’ for this theme.
Also, the booster plugin is not compatible with most useful plugins like akismet, all-in-one seo and so.
Hi, I updated to a new version of WordPress yesterday and noticed today that my page using the basic WordPress “add a password” to this page function is not working. It’s creating a loop pushing to: wp-login.php?action=postpass
Page: http://mauimagazine.net/digital-access/
I did some research and it’s easy to find enough information on the subject, showing this as the solution:
The solution is to change your theme functions file (/wp-content/your-theme-name/functions.php), replacing the reference to wp-pass.php with wp-login.php?action=postpass.
However, I wasn’t able to find the wp-pass.php anywhere in my Newspaper theme or child theme files. So I am unable to fix it so far.
Can you help with this? THANK YOU
That’s one of the things I have done. I renamed my plugins directory to plugins.old and xplugins on multiple occasions, but there are still issues showing:
This is right now with the plugins directory renamed.
supplied for foreach() in /home/deadic6/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php on line 2203
Warning: Cannot modify header information – headers already sent by (output started at /home/deadic6/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php:2203) in /home/deadic6/public_html/wp-includes/option.php on line 823
Warning: Cannot modify header information – headers already sent by (output started at /home/deadic6/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php:2203) in /home/deadic6/public_html/wp-includes/option.php on line 824
I will be re-enabling plugins though so the site has some functionality to it.
I also haven’t added any custom code or use a child theme yet.
Again, i appreciate the assistance!
Michael Gitkos
Hi,
This email came today AND when trying to log in here my browser reported that this is a “Reported attack site”.
Care to give some comments?
This email was sent from your website “24Uutiset” by the Wordfence plugin.
Wordfence found the following new issues on “24Uutiset”.
Alert generated at Sunday 13th of November 2016 at 06:40:57 AM
Critical Problems:
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/views/td_panel_custom_fonts.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/plugins/td-social-counter/td-social-counter.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/panel/views/td_panel_block_settings.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/td_config.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_api.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_block_widget.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_cake.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_menu_back.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/content-metaboxes/td_set_page_with_loop.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/td_view_system_status.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/views/ajax_boxes/td_panel_ads/td_get_ad_spot_by_id.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/views/ajax_boxes/td_panel_cpt_taxonomy/td_get_tax_settings_by_tax_name.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/views/td_panel_categories.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/views/td_panel_excerpts.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper/includes/wp_booster/wp-admin/panel/views/td_panel_header.php
* File contains suspected malware URL: /home/n4uuti5/public_html/wp-content/themes/Newspaper-child/functions.php
Hello,
The code in the functions.php file will require a bit of coding knowledge as it will not re-write the basic functions.php file. It will require a priority setting. Maybe this will help explain it better: https://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623
Overriding a function is a bit more tricky. You will have to know what you are doing. it will not be a copy and paste a bit of code situation. Customizing a theme;s code requires coding skills and knowledge.
Thank you!
Hello bz,
Yes, you can try to use the child theme for overwriting the code in functions.php file. For more information about our child theme support, please consult here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thanks for the message!
Thank you, Chris. That did the trick.
What are the chances of moving this functionality to the child-theme’s functions.php in the future?