WordPress.org

Support

Support » Themes and Templates » Help removing sub-page from vertical menu

Help removing sub-page from vertical menu

  • 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • WPyogi

    @wpyogi

    Forum Moderator

    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.

    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

    Will that not eliminate all subpages though?

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help removing sub-page from vertical menu’ is closed to new replies.
Skip to toolbar