Having problems Hinding wordpress pages

3 replies
  • WEB DESIGN
  • |
Hello Guys,

I am having a few problems, I am trying to figure out how to hide wordpress pages on a free theme I have found. Here is some of the code from the header.php



PHP Code:
</div><!-- Closes underHeader -->



<div id="nav">
<?php function get_the_pa_ges() {
  global 
$wpdb;
  if ( ! 
$these_pages wp_cache_get('these_pages''pages') ) {
     
$these_pages $wpdb->get_results('select ID, post_title from '$wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');

   }
  return 
$these_pages;
 }

 
function 
list_all_pages(){

$all_pages get_the_pa_ges ();
foreach (
$all_pages as $thats_all){
$the_page_id $thats_all->ID;

if (
is_page($the_page_id)) {
  
$addclass ' class="current_page"';
  } else {
  
$addclass '';
  }
$output .= '<li' $addclass '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
}
Any Ideas ?

Any help at all is appreciated.
#hinding #pages #problems #wordpress
  • Profile picture of the author Susan Hope
    Try adding the plugin to "exclude pages from menus" you tick a box if you want the page to show in any user menues, so if you want to hide a page, create it, and untick the box.

    Search for it in your "Add New" plugins area.

    Cheers
    Sue

    EDIT - This is the name of the plugin "Exclude Pages from Navigation"
    Signature
    One-to-One WordPress Coaching Service Available at Low Hourly Rate - Let the frustration end now! WordPress Installs, Theme Design, Site Tweaks & other WordPress services available
    Find me on Pinterest: PINTEREST
    {{ DiscussionBoard.errors[1289877].message }}
  • Profile picture of the author LoraGi
    I haven't seen such a complicated code,usually list_pages function is failry enough...

    To hide pages in the navbar you should paste your header.php in Notepad++ or other editor and find the matching closing php tag for
    Code:
     <?php function get_the_pa_ges() {
    It should look like this
    Code:
    ?>
    When you find it delete the whole function and that's it.
    I hope this helps
    {{ DiscussionBoard.errors[1291791].message }}
  • Profile picture of the author Audrey Harvey
    Susanne is on the ball, I use that plugin too, it's very simple to use.

    Here's the link WordPress › Exclude Pages WordPress Plugins
    Signature

    Expert content written by an experienced veterinarian and published magazine and newspaper writer.
    Feel free to contact me for details.
    {{ DiscussionBoard.errors[1291932].message }}

Trending Topics