Support » Fixing WordPress » [HELP] if page_link

  • Resolved uxte

    (@uxte)


    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';
    } ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    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.

    Bump

    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;
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[HELP] if page_link’ is closed to new replies.