• I have this theme and it uses a custom function to list pages, therefor I can’t excluse pages with the usual excluse or plugin. How can I excluse a page using this custom fs_list_pages function?

    # Displays a list of pages
    $fs_first = true;
    function fs_list_pages($parent=0) {
    	global $fs_first;
    	$pages = fs_get_pages($parent);
    	if (count($pages)>0) {
    		?><ul><?php
    		if ($fs_first) {
    			?><li class="f"><a href="<?php echo get_option('home'); ?>">ACCEUIL</a></li><?php
    			$fs_first = false;
    		}
    		foreach ($pages as $page) {
    			if ($page->id>0) {
    				?><li><a href="<?php echo get_permalink($page->id); ?>"><?php echo $page->title; ?><?php if (fs_has_subpages($page->id)) echo ' &raquo;'; ?></a>
    				<?php $count = fs_list_pages($page->id); ?>
    				</li><?php
    			}
    						if ($page->id>0) {
    				?><?php
    			}
    		}
    		?></ul><?php
    	}
    	$count++;
    	return $count;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • try changing this:

    if ($page->id>0) {

    to something like this:

    if ($page->id>0 && $page != 2) {

    or:

    if ($page->id>0 && $page->id != 2) {

    where “2” is the page ID you want to exclude.

    If that doesn’t work can you tell the theme you are using so we can see the entire code it uses?

    Thread Starter amnesic

    (@amnesic)

    THANKS!!!

    This works perfectly as you suggested tugbucket

    But What code do I have to edit if I want more than ONE page to be excluded?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom List_Page Function How to Excluse Pages?’ is closed to new replies.