Wsparcie » Motywy » Post navigation

  • Rozwiązano kamikadze88

    (@kamikadze88)


    U mnie w motywie kod w pliku single.php dotyczący nawigacji wygląda tak:
    <?php
    while ( have_posts() ) : the_post();

    get_template_part( 'template-parts/content’,’single’);

    the_post_navigation( array(
    'next_text’ => '<span class=”meta-nav” aria-hidden=”true”>’ . __( 'Następny Post’, 'words’ ) . '</span> ’ .
    '<span class=”screen-reader-text”>’ . __( 'Następny post:’, 'words’ ),
    'prev_text’ => '<span class=”meta-nav” aria-hidden=”true”>’ . __( 'Poprzedni Post’, 'words’ ) . '</span> ’ .
    '<span class=”screen-reader-text”>’ . __( 'Poprzedni post:’, 'words’ ),
    ) );

    // If comments are open or we have at least one comment, load up the comment template.
    if ( comments_open() || get_comments_number() ) :
    comments_template();
    endif;

    endwhile; // End of the loop.
    ?>
    Chciałbym go zmienić w ten sposób, aby zamiast „poprzedni post” i „następny post” wyświetlał mi tytuł postu. Co tutaj trzeba zmienić? Sprawdzałem w kodeksie, że kod php dla nawigacji wygląda tak:
    <?php previous_post_link( '%link’, '%title’, TRUE, ’ ’, 'neighborhood’ ); ?>
    Tylko gdzie go wstawić, aby nie rozpieprzyć sobie motywu.

Viewing 1 replies (of 1 total)
  • Thread Starter kamikadze88

    (@kamikadze88)

    Już sobie poradziłem. Wystarczy zastosować kod
    the_post_navigation();
    i po problemie.

Viewing 1 replies (of 1 total)
  • Temat ‘Post navigation’ jest zamknięty na nowe odpowiedzi.