Community Forums › Forums › Archived Forums › Design Tips and Tricks › Change Genesis Grid entry-title from H2 to P
- This topic has 9 replies, 3 voices, and was last updated 7 years, 2 months ago by
Genesis Developer.
-
AuthorPosts
-
March 12, 2016 at 9:55 pm #181297
fengshuimaster
MemberHi, by default the genesis grid entry-title I am having at my site is h2. How can I change it to Paragraph instead?
Thanks in advance.
http://fengshuimaster8u.comMarch 13, 2016 at 9:24 am #181339Davinder Singh Kainth
MemberThis can be good starting point - https://sridharkatakam.com/how-to-replace-entry-title-heading-tag-for-a-specific-featured-post-widget-using-gfpc/
As such, why you want to change? This is fine structurally.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesMarch 14, 2016 at 8:51 am #181407fengshuimaster
MemberYes that is a good read but ... I am using the standard "genesis featured page" widget only. Would love to change the H2 to standard text but with same size to H2.
Also to change the genesis grid H2 to standard text but with same size to H2 too.
Currently seems like many H2 in 1 page. Any further readings on it?
Thanks in advance
March 15, 2016 at 7:07 am #181454Davinder Singh Kainth
MemberStrictly from SEO point of view... one H1 and multiple (many) H2, H3... are fine.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesMarch 15, 2016 at 11:34 pm #181503fengshuimaster
MemberHi Davinder, thank you for your reply.
Yes, understood that it is alright for a H1 and many H2 / H3. As I am trying to put everything on the front page, I want to try change the following:Genesis Grid Loop (without plugin) post entry-title to H3
Genesis Featured Page (with plugin) page entry-title to H4
Other entry-title to PTried searching but unable to find a solution that works.
March 16, 2016 at 12:45 am #181507Genesis Developer
MemberHow to make the Grip loop? Are you using genesis_grid_loop() function? Can you share the home page snippet?
You can alter the title markup using this filter
genesis_entry_title_wrap
March 16, 2016 at 4:54 am #181519fengshuimaster
MemberHi Genesis Developer,
Not sure if it is the genesis_grid_loop() function, but I added the following to the front-page file.
add_action( 'genesis_before_content', 'add_genesis_grid_loop' );
function add_genesis_grid_loop() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 0,
'feature_image_size' => 'home-top',
'feature_content_limit' => 0,
'grid_image_size' => 'featured-image',
'grid_image_class' => 'aligncenter post-image',
'grid_content_limit' => 250,
'more' => __( '[Read More]', 'enterprise' ),
'posts_per_page' => 4,
) );
} else {
genesis_standard_loop();
}
}I think the genesis_entry_title_wrap is the correct one that I need but not sure how should I do it for the front-page only for grid loop and genesis featured page widget.
Do you think if you can provide me with the coding too?
Thanks in advance
March 16, 2016 at 5:26 am #181522fengshuimaster
MemberI added the following to front-page file and it works
function my_title_wrap(){ return 'h2'; } add_filter( 'genesis_entry_title_wrap', 'my_title_wrap' );
It still works in the homepage if I add it to function file but the actual single post has some error.
Now that I got the grid loop posts changed to h3, how can I change the entry-title for genesis featured page?
Thanks in advance
March 16, 2016 at 5:57 am #181523Genesis Developer
MemberI think that you can't change the title markup of Genesis Featured Page widget. But I shall double check it and inform you soon.
March 16, 2016 at 8:30 am #181550Genesis Developer
MemberI checked the genesis/lib/widgets/featured-page-widget.php file. Right now you can't alter the entry title markup. But you can unregistered the default page widget and create the same widget from your Child theme folder. Thattime you can alter the title markup.
For front-page.php file you can replace the current grip loop function with this code (Assuming that you added the filter in functions.php file)
add_action( 'genesis_before_content', 'add_genesis_grid_loop' ); function add_genesis_grid_loop() { if ( function_exists( 'genesis_grid_loop' ) ) { add_filter( 'genesis_entry_title_wrap', 'my_title_wrap' ); genesis_grid_loop( array( 'features' => 0, 'feature_image_size' => 'home-top', 'feature_content_limit' => 0, 'grid_image_size' => 'featured-image', 'grid_image_class' => 'aligncenter post-image', 'grid_content_limit' => 250, 'more' => __( '[Read More]', 'enterprise' ), 'posts_per_page' => 4, ) ); remove_filter( 'genesis_entry_title_wrap', 'my_title_wrap' ); } else { genesis_standard_loop(); } }
Carefully read the above code. I added two new lines add_filter( 'genesis_entry_title_wrap', 'my_title_wrap' ); and remove_filter( 'genesis_entry_title_wrap', 'my_title_wrap' );
March 16, 2016 at 7:01 pm #181600fengshuimaster
MemberHi Genesis Developer,
I followed your instruction by adding below code to function.php
function my_title_wrap(){ return 'h2'; } add_filter( 'genesis_entry_title_wrap', 'my_title_wrap' );
I then added your given code to front-page.php
add_action( 'genesis_before_content', 'add_genesis_grid_loop' ); function add_genesis_grid_loop() { if ( function_exists( 'genesis_grid_loop' ) ) { add_filter( 'genesis_entry_title_wrap', 'my_title_wrap' ); genesis_grid_loop( array( 'features' => 0, 'feature_image_size' => 'home-top', 'feature_content_limit' => 0, 'grid_image_size' => 'featured-image', 'grid_image_class' => 'aligncenter post-image', 'grid_content_limit' => 250, 'more' => __( '[Read More]', 'enterprise' ), 'posts_per_page' => 4, ) ); remove_filter( 'genesis_entry_title_wrap', 'my_title_wrap' ); } else { genesis_standard_loop(); } }
However, nothing changed. Did I miss a code?
March 16, 2016 at 7:18 pm #181601fengshuimaster
MemberHi Genesis Developer,
Your code works flawlessly. Thank you very much.
While for the Genesis Featured Page Widget, I don't really have the knowledge to do it. But since it is a widgetized area, can we use <div></div> to force it to rewrite title to H3?
Thanks in advance.
March 17, 2016 at 2:25 am #181624fengshuimaster
MemberGreat. The grid loop code works perfectly.
But I don't know how to unregister and register new featured page widget. I did some reading, is it possible to force and declare it to change the H tag in <div> since it is in a widgetized area.
Thanks in advance.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.