Forums

excluding a page from navigation on vistalicious theme (6 posts)

  1. nikosgr
    Member
    Posted 3 years ago #

    hi
    i switched on wordpress and i am very satisfied so far.

    all i need now, is to hide pages from the navigation menu (like the "about" near "home")

    in other templates, it is as easy as adding an "Exlude code" on header.php but i cant find it on vistalicious template!

    any recommendations?
    help in advance!

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    Look in the header.php file--it does a weird thing to get the pages--anyways I didn't test this but assuming About is ID=2 in your wp_posts table, change

    $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');

    to

    $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" and ID <> "2" order by ID');

    no idea how that is impacted by the get_cache line 36 in that header.php, but try the above.

    Otherwise you'd have to do an exclude in list_all_pages function...

  3. nikosgr
    Member
    Posted 3 years ago #

    i've already tried the exclude in list all pages but didnt worked. maybe i havent done it correctly. i will try the other one and let the forum know, if it works!

    thanks a lot for your time michael :)

  4. nikosgr
    Member
    Posted 3 years ago #

    it worked!
    cheers!

  5. rafriquelme
    Member
    Posted 3 years ago #

    Thanks! I had the same problem and the reco worked great. Indeed, a weird script to get the pages ...

    Now, a second question ... how to exclude more than one page from showing?

    Any ideas?

    Thanks in advance

  6. rafriquelme
    Member
    Posted 3 years ago #

    Ok ... I asked ... I tried ... I answer ...

    For multiple pages, a simple iteration:

    ... and ID <> "n"...

    will work.

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic