- This topic has 10 replies, 3 voices, and was last updated 4 years, 9 months ago by Leo.
-
AuthorPosts
-
December 21, 2019 at 3:16 pm #1110849Maxim
Hi, dear developer.
Your theme is pretty good =) i am happy to use it but i would like to make some little changes.
Could you explain to me how and where i can make changes for announcement’s and widget’s titles.
Now i have headings there but i want to make just divs or spans without using any headings because it is not so good for SEO.
I should use H1-H6 only for structuring of articles but not in announcment’s and widget’s titles.
Whre can i find php files (names) and what exactly do i have to change?Thanks a lot for your support =)
December 21, 2019 at 3:54 pm #1110865LeoStaffCustomer SupportHi there,
I’m not quite sure what you are announcement you are referring to?
Can you explain a bit more?
As for widget title, this should help:
https://docs.generatepress.com/article/generate_start_widget_title/
https://docs.generatepress.com/article/generate_end_widget_title/December 21, 2019 at 4:32 pm #1110872MaximHi =)
we have:
1. <header class-“entry-header”> (these are titles of announcments)
<h2 class=”entry-title”>…</h2>
</header>I want to remove h2 from it and replace with div. I assume, there some php file where i have to change
2. <aside id=”archives-2> (this is widget’s titles)
<h2 class=”widget-title”>…</h2>
</aside>Here i want to remove all h2 in widgets and replace with div for all widgets.
I think, there is some php file, and i have to make some changes.
3. <h3 class=”reply-title> (this is the button: Leave a comment)
I want to remove all h3 tags and replace with div.
I suppose there is some php file but i don’t know where and what do i have to change/I want to use h1-h6 tags only for structurization of articles but not for mark up others things in layout
December 21, 2019 at 4:39 pm #1110876LeoStaffCustomer Support1.
<h2>
is very common for posts titles and I believe it’s important for SEO.I don’t think it’s a good idea to remove that but if you still want to do it, then you’d need to use a child theme, copy the
content.php
file and paste in your child theme’s folder then edit this line:
https://github.com/tomusborne/generatepress/blob/master/content.php#L342. The filter I provided above should do.
3. Same thing as #1. You’d need to copy
comments.php
then modify this line:
https://github.com/tomusborne/generatepress/blob/master/comments.php#L44December 21, 2019 at 5:42 pm #1110898MaximHi Leo,
I think it is not what i wanted. Maybe these screenshots help:
https://ibb.co/KszhYVN
https://ibb.co/ng54QP7
https://ibb.co/pQ4B63nI want to change Heading tags for divs only for certain elements: anounncment’s tile, widget’s title and button “Leave a comment”.
These 3 elements are not content or article. H tags must not be placed there =) because these tags (h1-h6) are used only for structurization of articles but not for widget’s name (widget’s title should not be wrapped in h2). If i have the same h1 and h2 this will lead to cannibalization (because h1 in the article is the same like h2 in announcment). And i don’t need to have “Leave a Comment” wrapped in h3.that is really defficult to explain =)) Thank a lot for your suport =)))
December 21, 2019 at 6:00 pm #1110902Maximfinally i have found how to change announcment’s title h2 fot div tag =)))) hurray!!
https://ibb.co/QdpkH0j
https://ibb.co/ZXtrsCKBut where can i wrap widdet’s title in div instead of h2??
And Where is it possible to wrap button “Leave a comment” in just div tag??Thanks a lot for your help =))))))
December 21, 2019 at 7:05 pm #1110913LeoStaffCustomer SupportWidget titles:
https://github.com/tomusborne/generatepress/blob/7f9a2662f3388295407e96065fafe348b28a01b6/inc/general.php#L102
https://github.com/tomusborne/generatepress/blob/7f9a2662f3388295407e96065fafe348b28a01b6/inc/general.php#L103Reply title:
https://generatepress.com/forums/topic/change-h3-in-comments/#post-821318December 22, 2019 at 12:40 pm #1111535MaximHi, Leo.
I created a childtheme and then placed in it functions.php, content.php. I have made changes in these 2 files (in childtheme). All works nicely =)
But if i create and copy general.php (in childtheme) changes aren’t working from there. It seems general.php not to be seen form the childtheme. i can make changes in general.php in parenttheme directly but if themplate updates i will lose all my changes. That’s problem. How could i solve it?
Screenshot is here: https://ibb.co/hMBXCG9Thanks a lot =)))
December 22, 2019 at 8:39 pm #1111808TomLead DeveloperLead DeveloperHi there,
general.php
isn’t a template file, so it can’t be overwritten in your child theme.Instead, use these functions in your functions.php file:
add_filter( 'generate_start_widget_title', function() { return '<div class="widget-title">'; } ); add_filter( 'generate_end_widget_title', function() { return '</div>'; } );
December 23, 2019 at 8:31 am #1112430MaximHi Tom, all works ok =). Could you explain to me what diffrence between hook and filter?
Are filters and hooks the same things?Thangs a lot.
December 23, 2019 at 9:19 am #1112464LeoStaffCustomer Support -
AuthorPosts
- You must be logged in to reply to this topic.