I want to override defaultt single post template by child theme.

Posted in: Newspaper
Post count: 19

Hi I’m using default post template of newspaper theme, check my attachment. Now I want to override this “default post template” by child theme.
but I didnot find the exact default post template on newsparer main theme,
I tried this path: /wp-content/plugins/td-standard-pack/Newspaper/parts/single/single_template_1.php
I thought this one is default post template but I sw this one is not default post template.

Can you please help me to find out the exact path and file ?

https://snipboard.io/2WovJj.jpg
rete

Post count: 35449

Hi,
Yes, you can do that. The file that you should copy under the child theme is under this path: wp-content/plugins/td-composer/legacy/Newspaper/single.php. Make sure that you copy both files, single and loop single (the files should be set directly in the child theme, not under \parts\single).
In our guide, we mentioned how to overwrite only the standard pack templates- https://forum.tagdiv.com/the-child-theme-support-tutorial/ that are in a different place.

Post count: 19

Hlw, I want to override single news page title.
<h1 class=”entry-title”>news title….</h1>

here I want to add a new class like <h1 class=”entry-title my_custom_class”>news title….</h1>

but how can I override this file by child theme ?
I got the exact file of this title that is :
/wp-content/plugins/td-composer/legacy/common/wp_booster/td_module_single_base.php

will it be work If I copy this file into directly child theme ?

Post count: 20685

Hi,

I would like to ask what’s the purpose of adding a class on the title? If maybe it’s for design purposes, you could just target the titles in the post pages like this

.single-post .entry-title {}

No need for adding a new class just for targeting the titles in post pages. Or is it required for something else perhaps?

The module single base file isn’t customizable in the child theme unfortunately. it’s a code theme file, not a template. Modifying it directly will work, but it negates the purpose of the child theme. Maybe there are other better ways to do what you want. Could you explain the purpose of adding the class and using a child theme overall? I will try to help with what I can.

Thank you!

Post count: 19

Hlw, my site Europenewswire.net is News publishing service provide.
It has much child site where continuously publishing news using feed.
But the problem is- I need to create XPATH of single news title to grab it perfectly on child site.
XPATH needs a unique class/ID of title of single page. But Unfortunately I see your Newspaper theme use common class for single news title and other all template news title. That is very hard to create XPATH. that’s why I need a custom or unique calss

Post count: 20685

So what you are doing requires having a custom class for the title in the post pages. In that case you need to add one. I see you added it already, there is a custom class on the titles now. Well, if it’s required, then it has to be done. Besides modifying the core file you mentioned, or maybe outputting your own custom title directly in the post template, I don’t think there’s a different way to do it.

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.