• Resolved junx0r

    (@junx0r)


    A couple of questions I’m wrestling with, I’d appreciate some guidance.

    1. How can I style Prev/Next links? Ideally what I want to have in the navigation is just Prev and Next styled as CSS buttons.

    2. How can I insert a div just before or after the navigation? I’d like to insert a message or an ad just before or after it. Where would I put the code?

    Thank you! Great plugin and highly recommended!

    https://wordpress.org/plugins/page-links-single-page-option/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Studio Hyperset

    (@studiohyperset)

    Hi, junx0r:

    You can style your prev/next links by defining a “Link Wrapper Element” and “Link Wrapper Element Class” in the “Pagination Styles” module. We’ve considered integrating a feature that would add a specific variable to each class (eg., class-1, class-2) so users can style each individual page link. But this feature is still forthcoming.

    For now, then, if you want to target a specific page link, such as previous or next, you can use the nth-child pseudo class (http://css-tricks.com/how-nth-child-works/).

    Concerning your second point, PLP doesn’t offer a way to add HTML elements before or after the pagination string. As such, it’s probably easiest to just edit your theme. Find the wp_link_pages function and just add your ad/message div before or after.

    Thanks for your interest in PLP.

    Thread Starter junx0r

    (@junx0r)

    I see it is possible to insert HTML before and after the pagination string though, for example by default you insert <p>Pages, I see there’s an option for it.

    Is there a reason I can’t insert a div there?

    Where is that field that gets inserted before the pagination string in the code? I could add my code straight there in the source.

    Let me know if there’s a flaw with my thinking here.

    Plugin Author Studio Hyperset

    (@studiohyperset)

    Hi, junx0r:

    I’ve just tested the following content in the Pagination Styles > “Before” text box:

    <div></div><p>Pages:

    And it seems to work just fine.

    It wasn’t designed to accommodate the approach you outline, but I’m thrilled it does. Thanks for finding yet another thing PLP can do!

    Thread Starter junx0r

    (@junx0r)

    Thanks. If I wanted to add that code in the php file that processes the pagination (not through the WordPress interface), where would I add it? What file/line?

    The code I want to add would end up being a bit too long to insert through a text field.

    Thank you!

    Plugin Author Studio Hyperset

    (@studiohyperset)

    Hi, junx0r:

    I would advise against editing the plugin code.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Styling and inserting HTML’ is closed to new replies.