WordPress.org

Ready to get started?Download WordPress

Forums

How to exclude all but one? (or two, or three...) (8 posts)

  1. delFUEGO
    Member
    Posted 8 years ago #

    I need to place the pages list in 2 places:

    1). Navigation bar (below the header).
    2). Common list in sidebar.

    I thought of making 2 main pages (navigation-bar and common-list) and placing new pages inside them depending on where do I want to show them. But if I open a page, in the URL bar of the browser appears the name of the parent...

    ´http://www.myweblog.com/navigation-bar/mypage´

    ...and I dont want that. So I thought of some kind of "other way round" exclude. Instead of excluding some specific ID, I need to exclude all pages but number 1, 2, 3 and 4.

    Is there a way of doing this?

  2. moshu
    Member
    Posted 8 years ago #

    I assume 1, 2, 3 and 4 would go into the horizontal navbar, right? I'd just handcode that part - since it is unlikely to change often, and then use the template tag in the sidebar by excluding those four.
    In the Dark Maple theme I made a file (horizontal.php) where I handcoded the Pages for navigation and I call it with an include wherever I need it.

  3. delFUEGO
    Member
    Posted 8 years ago #

    The problem is that I need to change one of those navigation pages often. Not really me, but other person who don't have access to the code (my "client"). So I need it to be "friendly-changeable" throw "manage » pages".

    How can I include specific pages? (in code I mean), is it possible?

  4. moshu
    Member
    Posted 8 years ago #

    Re-reading your post now I got confused. When you say "pages" are you referring to Pages made by WP and included as a navigation?

  5. delFUEGO
    Member
    Posted 8 years ago #

    Yes, I meant Pages with capital P. Im sorry, Ill re write my problem:

    I need to have 2 types of Pages: The ones that appear in a horizontal bar below the header, and the rest, which will appear in the sidebar as a list as the categories or links does.

    So, I need to include some code in the header.php so it shows me only the pages I want, and leave the rest of the pages in the sidebar. I can exclude the horizontal bar Pages from the sidebar because they are only a few, but I can't exclude all the rest of the Pages from the horizontal bar because they will be a lot and I wont be the one whos making them. I mean, I can't be changing the templates code every time my "client" adds a new Page.

    I thought of placing the Pages in 2 "main" Pages, for eg: horizontal-bar & sidebar-list. But if I do so, whenever I open one page, the "parent/main" Page where its contained appears in the URL as the example I posted before:

    ´http://www.myweblog.com/horizontal-bar/mypage´

    Is there a way of including specific pages in a template?
    Or maybe some .htaccess code to exclude the "main/parent" Page name from the URL?

    Thanks for your pacience, and excuse my spelling, Im from Argentina.

  6. delFUEGO
    Member
    Posted 8 years ago #

    I think I might found something, but I haven't tryed yet...

    WordPress plugin: Improved Include Page

    ...anyway, I thought of adding the Pages in the template manually, but again, I need it to change automatically if the "client" changes the Pages name via the admin panel.

    Any idea?

  7. moshu
    Member
    Posted 8 years ago #

    Convince the client it's an idiotic idea :)
    If those Page names are used for a navigation bar (as stated in OP) then every visitor wants to find the same navigation items whenever they come back. Why would anybody want to change the link text?
    (N.B. you can still change the content of those Pages)

  8. delFUEGO
    Member
    Posted 8 years ago #

    He wants to change the link text because it has a year in it. Its some kind of anual gathering (somewhere around feb/march) and they start changing the content of next year gathering in Nov/Dec. But if there isn't an easy way of adding a Page link with its title changing automatically, then I'll try to convince him it's an idiotic idea :D. No, really, instead of "2006 Gathering" I'll put "Next Gathering" or something like that.

    Anyway, I thought there was an "insert_this_template_tag" way of adding single Pages wherever I want. Maybe this should be in "Features" forum?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags