Community Forums › Forums › Archived Forums › General Discussion › Magazine Pro Theme & rel next on home
Tagged: magazinepro, pagination, relnext
- This topic has 6 replies, 2 voices, and was last updated 8 years, 2 months ago by
Oliver.
-
AuthorPosts
-
December 18, 2017 at 3:23 pm #214671
Oliver
MemberI don't know if this is new or if I never noticed that on the home, but it's not good and I want to remove it.
<link rel="next" href="http://www.....com/page/2/" />I know I can remove it by adding this to functions.php
remove_action( 'wp_head', 'genesis_paged_rel' ); remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );BUT I want to keep it on my posts just not on my Home.
Any suggestions?
December 19, 2017 at 2:43 am #214680Victor Font
ModeratorWrap the remove_actions in a WordPress conditional:
if ( is_front_page() || is_home() ) { remove_action( 'wp_head', 'genesis_paged_rel' ); remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); }https://codex.wordpress.org/Conditional_Tags
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 19, 2017 at 10:23 am #214685Oliver
MemberDear Victor,
tried that already but that's not working with the Magazine Pro Theme.
Any other idea?
December 19, 2017 at 12:58 pm #214686Victor Font
ModeratorPlease post a link to your site.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 19, 2017 at 4:36 pm #214692Oliver
MemberHi Victor.
It's exactly the same in the Studiopress Theme Demo.
<link rel="next" href="https://demo.studiopress.com/magazine/page/2/" />Check line 56 / 57. Theme is using latest post and not a static page as home and if I'm right, that's the reason why it generates this tag in the first place and also why it's not possible to filter it by is_home.
thanks
December 20, 2017 at 6:25 am #214698Victor Font
ModeratorThat's why I also included is_front_page()
The Front Page
is_front_page()
When the front of the site is displayed, whether it is posts or a Page. Returns true when the main blog page is being displayed and the 'Settings > Reading ->Front page displays' is set to "Your latest posts", or when 'Settings > Reading ->Front page displays' is set to "A static page" and the "Front Page" value is the current Page being displayed.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 25, 2017 at 1:13 am #214792Oliver
MemberThanks Victor, I know what is_front_page() is doing but as I wrote, it's not working in that theme with just that code.
I tried some other things and when I add it together with check_home(), it's working without any problems.
add_action('wp', 'check_home'); function check_home() { if(is_home() || is_front_page()) { remove_action( 'wp_head', 'genesis_paged_rel' ); remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); } }Enjoy your Holidays
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.