• This may not be as much a support question as a feature request, but wanted to submit it before offering a review.

    Plugin works great as installed, the only problem I have with it is it shows top level pages if the page has no subpages. My preference would be that the widget not show at all if there are no children for a specific page, not link back to the top level pages of the site. Any chance that there could be a checkbox for that behavior?

    Thanks!

    Bob

    https://www.ads-software.com/plugins/list-sub-pages/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WeblineIndia

    (@weblineindia)

    Hello Bob,

    I would say nice suggestion for this. We will have this added in upcoming version of plugin.

    Thanks

    Dear WeblineIndia,

    I have a different request for a feature.
    Is there a option that I can choose to display all sibling pages (pages with the same parrent) in a list?

    So far the extension is working great, thanks for that!

    Kind regargs,

    Maarten

    use this

    //$pages=wp_list_pages($args);
        $parents = get_post_ancestors( $post->ID );
    	$id = ($parents) ? $parents[count($parents)-1]: $post->ID;
    	$args = array(
        			'order' => $sort_order,
        			'post_parent' => $id,
        			'post_status' => 'publish',
        			'post_type' => 'page',
        	);
    	$attachments = get_children( $args );
        				foreach($attachments as $attachment)
        	    { if(($attachment->post_title != $thispagetitle)): ?>    
    
        	    			<li><a href="<?php echo $attachment->guid;?>"><?php echo $attachment->post_title;?></a></li>
        	    		<?php 	endif;
        	    }
        			   print_r($pages);

    under else when checking if($attachments)
    in the file plugin_list_subpages.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing top pages when no child page exist’ is closed to new replies.