Support » Fixing WordPress » How to stop parent pages from linking

  • Hi all

    I am a newbie to WordPress I have just be playing with it for a few days I am using 2.7.1 (latest). I am not sure if I need a plugin or need to do some changes to the code.

    I have been using the painter theme; in the menu system, it is using wp_list_pages, which is built into wordpress. The issue I have is that I’ve made static page with child pages. Which will form the menu for the site.

    IE Static Page 1 (parent)
    -Page 1 child 1
    -Page 1 child 2
    -Page 1 child 3
    -Page 1 child 4

    Static Page 2 (parent)
    -Page 2 child 1
    -Page 2 child 2
    -Page 2 child 3

    In menu (list_Pages) parents will show with drop down menu for child pages, so Page 1 Page2 and so forth

    The parents have clickable links which you are able to see when you hover over the link. How can you stop this so that the parent links isn’t clickable?

    IE Static Page 1 parent = ?p=8 Clickable link
    -Page 1 child 1
    -Page 1 child 2
    -Page 1 child 3
    -Page 1 child 4

    Static Page 2 parent = ?p=15 Clickable link
    -Page 2 child 1
    -Page 2 child 2
    -Page 2 child 3

    Is there a plugin somewhere, or do I need to alter the list_page with some code to achive a none clickable result.

    Can anybody help please

Viewing 9 replies - 1 through 9 (of 9 total)
  • Maybe two instances of the template tag, wp_list_pages():

    wp_list_pages(‘child_of-8&title_li=Static Page 1 parent’);
    wp_list_pages(‘child_of-15&title_li=Static Page 2 parent’);

    use extended categories plugin, you can make a heading that isnt clickable and choose what parent/child you want under it, very useful.

    Thread Starter zandebar

    (@zandebar)

    Thanks; thats intresting I will have a look at both I will try the hard coding cheers for that MichalH.

    But the plugin looks OH so very appealing just for an out of a box solution. Thankyou mangagrl251 – I will give that a blast.

    TY

    @mangagrl251 – please provide a link to that plugin. Thank you.

    Thread Starter zandebar

    (@zandebar)

    Michael I believe that this is the link for that plugin;
    http://wordpress.org/extend/plugins/extended-categories-widget/

    I have tried it, looks good but sadly doesn’t do what I want it to do.

    I have tried your suggestion; works and does exactly what you said it would. I am at the moment reading up on the http://codex.wordpress.org/Template_Tags/wp_list_pages page

    As I have modified the painter theme and wanting to remove the linking parents. My PHP knowledge isn’t that great and I am at the learning stage, so please forgive me.

    Your suggestion works, but I find that the style is not applied and the drop down menu works too fast. I get the feeling that I have other areas to modifiy.

    Any pointers ?

    Thread Starter zandebar

    (@zandebar)

    I have been using the painter theme located here: http://wordpress.org/extend/themes/painter

    In the header.php this is the remark for the list_pages call
    <?php wp_list_pages(‘depth=2&title_li=’); ?>

    Michaels recommendation of
    wp_list_pages(‘child_of-8&title_li=Static Page 1 parent’);
    wp_list_pages(‘child_of-15&title_li=Static Page 2 parent’);

    works but as mentioned above loses formatting(css, I presume, but can’t see why) and dropdown menu timings are too quick. Am puzzled as to why this changes has made such a behaviour change.

    I am happy calling each parent if need be in the header.php, but would like some help and afew pointers if anybody can help.

    I am learning PHP and only a beginner, as with wordpress. I kind of have my answer now its just making it work.

    In hope

    Thread Starter zandebar

    (@zandebar)

    MichaelH, can you give me any pointers as to why the drop down menu collaspes. When you lose focus on the main parent title ?

    using your > wp_list_pages(‘child_of-8&title_li=Static Page 1 parent’);
    suggestion

    I used it like this >><?php wp_list_pages(‘child_of-6&title_li=’);?> and its the same, give it a title and it does the above.

    Thread Starter zandebar

    (@zandebar)

    The intresting thing is, thats its doing what I am asking it to do list child pages of parent. But the drop down menu fuction is not working.

    So am wondering what have I missed ?

    Not sure if this is the problem but my code says “child_of-” and that should be “child_of=” (equal sign, not minus sign). Sorry.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to stop parent pages from linking’ is closed to new replies.