WordPress.org

Ready to get started?Download WordPress

Forums

Ambrosite Next/Previous Post Link Plus
[resolved] Add link to the whole block rather than just the title? (3 posts)

  1. cwulff
    Member
    Posted 1 year ago #

    Just wondering if there's a way to move the link from the title to before the containing div in the 'before' element so that the whole div is wrapped in the a rather than just the title.

    <?php next_post_link_plus( array(
      'format' => '<span class="sectionlabel">Next Post</span> %link <span class="date">%date</span><i class="icon-angle-right"></i>',
      'date_format' => '',
      'tooltip' => '',
      'in_same_cat' => true,
      'before' => '<div class="pagination nextpost">',
      'after' => '</div>',
      'num_results' => 1,
      'return' => ''
     ) ); ?>

    See http://richmoran.wpengine.com/in-the-workplace-a-special-day-at-the-office/ for the output.

    Many thanks for this very cool plugin.

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

  2. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    You could try putting the before and after code inside the link parameter, like this:

    <?php next_post_link_plus( array(
      'link' => '<div class="pagination nextpost"><span class="sectionlabel">Next Post</span> %title <span class="date">%date</span><i class="icon-angle-right"></i></div>',
      'format' => '%link',
      'date_format' => '',
      'tooltip' => '',
      'in_same_cat' => true,
      'num_results' => 1,
      'return' => ''
     ) ); ?>

    Not tested but I think it should work. If it doesn't, the only other solution would involve hacking the plugin code.

  3. cwulff
    Member
    Posted 1 year ago #

    You, sir, are a gentleman and a scholar! Worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags