Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add post title to pagination Eleven Twenty Pro
- This topic has 2 replies, 1 voice, and was last updated 10 years, 5 months ago by samw.
-
AuthorPosts
-
March 19, 2014 at 12:54 am #95624samwMember
Hi
I am trying to edit the post navigation links in Eleven Twenty Pro to display the post title.
Where is the place to edit this - cant find anything in functions.php or do I need to add a new function?
Tried adding this to functions.php to test if its the right code but as no changes appeared in the link text, i guess not?
//* Add post navigation (requires HTML5 theme support)
remove_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav' );
add_action( 'genesis_entry_footer', 'cookie_prev_next_post_nav' );function cookie_prev_next_post_nav() {
if ( ! is_singular( 'post' ) )
return;genesis_markup( array(
'html5' => '<div %s>',
'xhtml' => '<div class="navigation">',
'context' => 'adjacent-entry-pagination',
) );echo '<div class="pagination-previous alignleft">';
previous_post_link('%link', 'new text1');
echo '</div>';echo '<div class="pagination-next alignright">';
next_post_link('%link', 'new test 2');
echo '</div>';echo '</div>';
}If anyone can help be appreciated
1. Code or place to edit post navigation links in Eleven Twenty Pro to display post title
many thanks
March 19, 2014 at 2:42 am #95628samwMemberFollow up:-
Tried this code and no luck
function wpsites_npp_navigation_links() {
if ( is_single ( ) ) { ?>
<?php previous_post('« « %', 'Previous', 'yes'); ?>
| <?php next_post('% » » ', 'Next', 'yes'); ?>
<?php
} }add_action('genesis_entry_footer', 'wpsites_npp_navigation_links', 5 );
To clarify:-
Front page set to static - showing blog posts
Theme pagination only showing on archive pages
Issues:-
1. Add previous/next pagination to posts both archived and not
2. How to display post title in pagination links - theme setting with numeric or previous next works
Thanks
March 20, 2014 at 2:48 am #95769samwMemberHi
Working Code Here
Working Code Here
//* Add post navigation (requires HTML5 theme support)
remove_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav' );
add_action( 'genesis_entry_footer', 'cookie_prev_next_post_nav' );function cookie_prev_next_post_nav() {
if ( ! is_singular( 'post' ) )
return;genesis_markup( array(
'html5' => '<div %s>',
'xhtml' => '<div class="navigation">',
'context' => 'adjacent-entry-pagination',
) );echo '<div class="pagination-previous alignleft">';
previous_post_link('<span class="single-post-nav previous-post-link">%link</span>', get_previous_post_link('%title') , TRUE);
echo '</div>';echo '<div class="pagination-next alignright">';
next_post_link('<span class="single-post-nav next-post-link">%link</span>', get_next_post_link('%title') , TRUE);
echo '</div>';echo '</div>';
}This only works on a post level, and does not change the default archive pagination - working on that!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.