• This plugin it’s one of the most useful things I’ve found on WordPress and it works perfectly right on my theme.

    But (there’s always one but, isn’t it?), I’d like to use it on the previous/next buttons. Right now It appears in this format:

    “Previous/Next Post
    Post Title”

    And I’d like it to appear as:

    “Previous/Next Post
    Post Title
    Seconday Title”

    Is there anyway to add the seconday title there?

    Currently the code for that button is the following one:

    // Previous/next post navigation.
    			the_post_navigation( array(
    				'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'afterlight' ) . '</span> ' .
    					'<span class="screen-reader-text">' . __( 'Next post:', 'afterlight' ) . '</span> ' .
    					'<span class="post-title">%title</span>',
    				'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'afterlight' ) . '</span> ' .
    					'<span class="screen-reader-text">' . __( 'Previous post:', 'afterlight' ) . '</span> ' .
    					'<span class="post-title">%title</span>',
    			) );

    Many thanks!!

    • This topic was modified 7 years, 4 months ago by poligonwp.
    • This topic was modified 7 years, 4 months ago by poligonwp.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author thaikolja

    (@thaikolja)

    Hi @poligonwp,

    Sure, you can use the PHP function get_secondary_title() to display it anywhere within your code. Try this (not tested):

    array(
                    'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'afterlight' ) . '</span> ' .
                        '<span class="screen-reader-text">' . __( 'Next post:', 'afterlight' ) . '</span> ' .
                        '<span class="post-title">%title</span><div class="secondary-title-post-navigation">' . get_secondary_title() . '</div>',
                    'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'afterlight' ) . '</span> ' .
                        '<span class="screen-reader-text">' . __( 'Previous post:', 'afterlight' ) . '</span> ' .
                        '<span class="post-title">%title</span><div class="secondary-title-post-navigation">' . get_secondary_title() . '</div>',
                ) );
    Thread Starter poligonwp

    (@poligonwp)

    Hi @thaikolja!

    Many thanks for your answer! Sadly, it just partly works. I mean, it displays the secondary title of the current post, but as I need it in the Previous/Next Post buttons I would need to display there the Secondary Title of the Previous and Next posts.

    I don’t know if there is any way to make that possible.

    In any case… many thanks for your help!

    Plugin Author thaikolja

    (@thaikolja)

    If you give me a visual mockup of how you want it to look like and FTP access, I can do you the favour of implementing it for you. Otherwise, we’ll end up spending days trying to get it work because I don’t have a platform to test this.

    If you’re comfortable with that, please contact me privately via [email protected].

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Secondary title on Previous/next post navigation’ is closed to new replies.