WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [HELP] if page_link (5 posts)

  1. uxte
    Member
    Posted 5 years ago #

    Hey,

    I have a modified page_link navigation that I want to show only if the page is broken (using the <!--nextpage--> quick tag).

    So I was wondering is something like this could work:

    <?php if function_exist(('link_pages')) {
    	echo 'yes';
    	} else {
    	echo 'no';
    } ?>
  2. tsguitar
    Member
    Posted 5 years ago #

    What is the page_link navigation you want to set? With wp_link_pages, you've got quite a few parameters you can set:
    http://codex.wordpress.org/Template_Tags/wp_link_pages

    So before, after, nextpagelink, previouspagelink, pagelink, and more_file should allow you to do what you want to do, right? I think you're creating a function for something that already exists. Give me more details so I can get a better idea of what you're trying to do.

  3. uxte
    Member
    Posted 5 years ago #

    Thanks for the reply tsguitar,

    The code I'm using is bellow:

    <div id="pagenav" class="navlink">
    							<span class="alignleft"><?php link_pages('', '', 'next', '', '<img src="wp-content/themes/brink/images/button_prev.gif" alt="Previous button"/> Previous page'); ?></span>
    							<span class="alignright"><?php link_pages('', '', 'next', 'Next page <img src="wp-content/themes/brink/images/button_next.gif" alt="Next button"/>', ''); ?></span>
    						</div>

    I'm using images for the navigation and the "pagenav" has a background associated with it. Like it is right now when there is no subpages it shows the "pagenav" background, what I want is that in that case nothing shows. Basically I want to show/hide the pagenav div depending on if there are subpages or not.

  4. uxte
    Member
    Posted 5 years ago #

    Bump

  5. uxte
    Member
    Posted 5 years ago #

    Ok I found the answer for this one, thanks Otto42 for the hint ;)

    If anybody's looking for the same here is the code:

    <?php
    	if ( $numpages > '1' ) :
    	echo $numpages;
    	else :
    	echo no pages;
    	endif;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags