1

I have a wordpress site with 100+ pages. Now suppose 5 pages are related to page 1, and I want to show them in side bar as similar pages/related pages and other group of pages in other menu in sidebar. There is no child-parent relationship between these pages all are in root including homepage.

Same goes for other pages also, they all have to show different pages as related and other pages in sidebar.

So every page has different links under sidebar grouped in two different menu, one related pages other other pages.

The possible solution i found is using these plugins;

  1. Dynamic Widgets , in this case i create lot of custom menu and show them on pages in custom menu widget and control by this plugin. Very tedious job, I have to create more than 20 custom menu.

  2. Flexi Pages Widget , In this case i create several page widgets(more than 20) and control with Dynamic Widgets to show them on different pages.

Now both solution i find not look good to me, any suggestions on this?

One more solution come to my mind is go in PHP/code and create different sidebars, but not look feasible to me.

You valuable reply in this regard is highly appreciated. Thanks in Advance!

Update: Using advance custom fields plugin, with relationship fields.

1 Answer 1

0

I think you may be making this more complicated than it needs to be.

  1. Use custom meta fields to associate the different pages. You could use the built in "Custom Fields" meta box or build your own meta box for this "association" field. Populating your sidebar is then a matter of a meta_query.
  2. Use tags to associate related posts. Populating your sidebar is a matter of a tax_query.

Whichever you use, you would only need one sidebar widget to pull the related posts.

2
  • I think you mean custom fields, so I create one custom field related pages, second other pages. Now put links or page title in value field, or i have to search how to do this and then add query in my sidebar.php? Jun 8, 2013 at 13:26
  • I'm sorry. It is not clear exactly what you are asking but that sounds right, if you decide to use custom fields. The Codex has several meta_query examples on the WP_Query page and this site has a lot of information about doing that as well. I'd consider using tags though. That is what they are for.
    – s_ha_dum
    Jun 8, 2013 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.