I’m bringing up an online storefront on my existing Newspaper8 site using EDD. The way EDD works it only lets me use the default page style from Newspaper8, so I have had to create a child theme and create single-download.php to make it look like I want.
I am able to tweak this template to override everything I want to disable (the social share, the “Related Articles”, ads, etc.) using the template and overriding the short code for ads and adding a simple conditional based on the post type ‘download’.
I also want to override the “more articles” slider element so it does not show up on posts of type ‘download’. While digging through the code I found a method td_options::update_temp() that lets me do exactly what I want by just adding a single line to the template. However, that method is documented with a “deprecated” warning not to use it. This solution is just so simple:
td_options::update_temp('tds_more_articles_on_post_pages_enable','no');
So my question is if there is any other approved official way to override a setting for my post type this way?
The other option I have is to copy the includes/wp_booster/td_more_article_box.php file into my child theme and add a one-line change to add the conditional there, but that just makes for more long-term maintenance work for me on every theme update.
That is not my experience. I need to explicitly turn off that setting for the post type ‘download’ or the more articles slider comes in as I scroll the page.
So my question stands: is there some official way to locally suppress a global setting from my template like the update_temp() function does, or is the only official way to copy and edit the more articles PHP file in my child theme?
I would request that the deprecated status of the update_temp() be lifted, and it be kept as official for such purposes. It is much simpler in this case.
Thanks!
Hi,
I really couldn’t say when the deprecated will be removed, or if it would be an issue using it. If you made tests and it works you could use it for the moment.
Or modify the file in the child theme, I believe you should be able to modify it and add your conditions, in a child theme.
Thanks