• Resolved jcdjcd79

    (@jcdjcd79)


    I’m using WordPress 2.9.2 and my theme is StudioPress_Red. I really want to hide some pages but the problem is I can’t seem to find the “<?php wp_list_pages();?>” code. Could you please tell me what to edit in this certain theme so I could make the hide pages hack work. I tried Exlude Pages and Advace Category Excluder plugins but they don’t seem to work in this theme…

    StudioPress_Red

Viewing 15 replies - 1 through 15 (of 28 total)
  • Something like

    <?php wp_list_pages('title_li=&depth=&exclude=2');

    Will exclude a page with ID 2 from the menu.

    if I remember correctly, this theme uses a completely different class in the header
    post the header.php to wordpress.pastebin.ca
    and come back here with link

    Thread Starter jcdjcd79

    (@jcdjcd79)

    @ss_minnow – But that is my problem… I can’t find that particular code in the theme that I’m using.

    Thread Starter jcdjcd79

    (@jcdjcd79)

    Download the whole theme and use an HTML editor that has Advanced Search & Replace. Then you can search all files in the folder for wp_list_pages.

    With Windows you can probably also browse to the folder then use the Search function, choose All Files & Folders, and then put wp_list_pages in the box that says “a word or phrase in the file”. I have never tried that but since php files are just plain text, it should work.

    But if Samboll is saying that it’s coded differently, maybe that is not how the menu is coded at all.

    Thread Starter jcdjcd79

    (@jcdjcd79)

    @ss_minnow – Yep, I tried that because I thought it’s the best way to find that code and I guess it’s really not there. Maybe there’s a different code to edit but I really don’t have a clue =(

    as I feared – a non-standard wp theme framework
    to be honest, I don’t have a clue
    I looked for a hook in the theme’s functions.php file but I don’t understand it

    hopefully someone else knows

    Thread Starter jcdjcd79

    (@jcdjcd79)

    @samboll – Hmmmn… Thanks for trying. I still hope somebody could help me with this.

    ok – I figured it out

    open theme'sheader.php`
    find this code

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

    replace with this code

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

    where you see the # signs, replace with your page id

    to exclude multiple pages use this

    <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" and ID != "3" and ID != "5" order by ID');
       }

    replace the id’s with your real id’s of course

    tested and works on my local install

    Thread Starter jcdjcd79

    (@jcdjcd79)

    @samboll – I’ll try it right now!

    Thread Starter jcdjcd79

    (@jcdjcd79)

    @samboll – Thanks for the help! The 1st method messes up my site but the 2nd method works like a charm! So everytime I would like to exclude a page, I would be adding a “and ID != “x”” to the code?. Thanks again!

    I would be adding a “and ID != “x”” to the code?

    yes – with the proper spacing
    strange the 1st didn’t work, but glad you got it

    HI Samuel B,
    anyone who can resolve
    i’m, also using wordpress 2.9.2 and the theme – AFTERBURNER by rocket theme. i can’t find way to hide pages. \Anyone to help me?
    pls

    sandesh
    that is a paid theme so I can’t download it
    paste the contents of the theme’s header.php at pastebin.com and come back with link and I will look at it

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘Can’t hide pages’ is closed to new replies.