• Resolved tukane

    (@tukane)


    Hi,

    is there a way to add navigation links to each match page, so that you can quickly navigate to the next or the previous match?

    Thanks,

    tukane

Viewing 5 replies - 1 through 5 (of 5 total)
  • fjmroca

    (@fjmroca)

    Good question. I’m interested too

    Plugin Contributor Savvas

    (@savvasha)

    Hi there @tukane ,

    It will need some custom code to achieve this. Events/Matches are Custom Post Types with key sp_event.You can find more info at https://wordpress.stackexchange.com/questions/31545/custom-post-type-next-previous-link

    Thanks,
    Savvas

    Hello,

    I use a similar code on my website. I put it in the event-detail.php file, which is in the plugin’s template folder! I hope this helps you.

    /* Previous match */

    <?php
    $previous_post = get_previous_post();
    if (!empty( $previous_post )): ?>
    <a href="<?php echo esc_url( get_permalink( $previous_post->ID ) ); ?>" title="Previous match">Previous match</a>
    <?php else:
    echo "&nbsp;";
    endif; ?>

    /* Next match */

    <?php
    $next_post = get_next_post();
    if (!empty( $next_post )): ?>
    <a href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>" title="Next match">Next match</a>
    <?php endif; ?>
    Plugin Contributor Savvas

    (@savvasha)

    Hi @plou ,

    Thanks for sharing your solution!

    Savvas

    fjmroca

    (@fjmroca)

    Hola @plou

    ?Dónde lo colocas exactamente? ?En qué parte del archivo? Gracias

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.