Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assigning Child Pages to Non Existent Parent Pages in WordPress

Tags:

wordpress

menu

I'm surprised that after searching for so long I couldn't find any solution to my problem and so I thought of posting it here :)

So we can create 'pages' in WordPress and drag and drop them under 'menus' as we like to create a parent-child relationship. But what if we have a non-existent page using a custom link such as '#', how can we assign a child page to that particular parent page that doesn't exist?

So I have 'Parent 1' that has been added as a custom link under menus and the url is basically '#'. Obviously, that won't be registered as a parent page because it's a custom url but I don't need to add it as a parent page, it's more of a reference in the top menu. The main reason I'd want to do this is to make use of breadcrumbs. Thoughts?

like image 581
paradeshi Avatar asked Nov 01 '25 15:11

paradeshi


1 Answers

Without messing with rewrite rules or custom slugs, why not just create a blank page and set the hierarchical relationship the normal way.

On the Menu you can still use the Custom Link # item and place the children accordingly. You can even name the blank page "Parent (Intentionally Left Blank)" so it's less confusing in the admin.

This would also allow you to have the appropriate hierarchical structure in your admin when you view the All Pages admin page that looks like:

  • Parent (Blank)
    • Child 1
    • Child 2
like image 67
Xhynk Avatar answered Nov 04 '25 18:11

Xhynk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!