WordPress.org

Forums

Help removing sub-page from vertical menu (5 posts)

  1. Tyndalea
    Member
    Posted 2 years ago #

    I have a website that I am building and about to launch at

    http://www.tyndale-archers.co.uk

    The template was built in Artisteer (I am a teacher by trade, not a website builder!) but I now want to remove the "latest news" page under the "News" section of the site. (Note - we still want the News and other subpages attached to it, just not the lates news page).

    I tried putting the (suggested when googling) 'exclude' code within the below code but managed to lock myself out the site and had to go into the FTP files via my host to get it back!

    I think (thought?!) the correct place to place the exclude code was within this bit of code below:

    /* pages */

    function theme_get_list_pages($args = array()) {
    global $wp_query;
    $pages = &get_pages($args);
    if (empty($pages))
    return '';

    i.e.

    /* pages */

    function theme_get_list_pages($args = array()) {
    global $wp_query;
    $pages = &get_pages($args, 'exclude = 849);
    if (empty($pages))
    return '';

    849 being the page name for the latest news page.
    However this didn't work as descibed above!

    I've tried changing the template in Artisteer and then uploading along with content transfer (which means I have to re type/paste/edit all the content as this effectively wipes existing uploaded/created content) but with no success. I am loathed to move on with typing up all the content until this is fixed however for fear of loosing it for the 4th time!

    HELP!

    Many thanks

  2. WPyogi
    Forum Moderator
    Posted 2 years ago #

    Sorry, but Artisteer themes are not supported here - so can only suggest that you ask them for help. These forums only support themes from the repository on this site.

  3. p5systems
    Member
    Posted 2 years ago #

    Hi

    You can use wp_nav_menu with depth parameter. os w ecna elminate the sub pages.

    <?php wp_nav_menu('child_of=9&depth=1'); ?>
    depth=1 shows it display the top level pages.
    you cna also use get_pages function

    Thanks
    P5systems

  4. Tyndalea
    Member
    Posted 2 years ago #

    Will that not eliminate all subpages though?

  5. sulaphen_mani
    Member
    Posted 2 years ago #

    did you tried through the admin panel
    if not means go admin panel -> appearance -> menu ->
    you can see all pages listed with your sub pages .
    just delete the unwanted pages from it.

Topic Closed

This topic has been closed to new replies.

About this Topic