WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help needed with php navigation (3 posts)

  1. minademas
    Member
    Posted 6 years ago #

    Help!
    I have worked on my pagination and now my single post pagination is off. Please see it here:
    http://www.minademas.com/2008/01/02/introduciendo-al-mundo-womee/

    As you can see, I can now see 2 styles of pagination, the article ones and below that the new navigation by pages.

    My code on navigation.php is:

    <?php if (is_single()) : ?>

    <div class="navigation">

    <span class="previous"><?php previous_post_link('← %link') ?></span>

    <span class="next"><?php next_post_link('%link →') ?></span>

    </div>

    <div class="clear whitespace"></div>

    <?php endif; ?>

    <?php if(class_exists('wp_pagination_plugin')){
    $p = new wp_pagination_plugin;
    $p->show();
    $p->nextLabel(''); // removing text 'next'
    $p->prevLabel(''); // removing text 'previous'
    $p->nextIcon('►'); // changing the icon 'next'
    $p->prevIcon('◄'); // changing the previous 'icon'
    }

    -------
    How can I fix it so on the Single post I can only see the article navigation and NOT the pagination style? I know it has something to do with the php if, but I dont know how to put it correctly. Tks!

  2. minademas
    Member
    Posted 6 years ago #

    Any idea guys? please!

  3. Kafkaesqui

    Posted 6 years ago #

    "How can I fix it so on the Single post I can only see the article navigation and NOT the pagination style?"

    http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page

    Use the conditional linked above to do something like:

    <?php if( is_single() ) : ?>
    
    ~ displays on single post pages only ~
    
    <?php endif; ?>

    Or alternatively:

    <?php if( !is_single() ) : ?>
    
    ~ displays anywhere but on single post pages ~
    
    <?php endif; ?>

    (PHP info: ! = NOT in this situation)

Topic Closed

This topic has been closed to new replies.

About this Topic