WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Contextual sidebar with related Pages (3 posts)

  1. Dodo67
    Member
    Posted 5 years ago #

    Hi all,

    I'm working on a blog with news contents, something like a newspaper site.
    I need to create a contextual sidebar, where some lists of items (posts, pages, links etc.) are 'related' to the current page content.

    The blog contains news about Africa, so for example, if the user is reading a posts about something happened in Republic of South Africa, how can I show a list of Pages containing general info about that nation?
    And, how to display that same list of Pages if he is on the category page about that nation?
    Again, how to display that same list if he's reading one of that same Pages with general info about South Africa Republic?

    Of course my first idea setting up the blog was to use categories: a set of categories for topics, plus a category for each nation in Africa (53 nations => 53 categories all children of a 'Nation' root category).
    So no problem for 'related posts' list, there are many plugins for this.
    The problem rise with Pages (i mean static contents saved in WP Pages). Ho to display links to Pages related to current post?

    Is it possible to do this? How? There are no categories for pages. How to 'connect' posts with Pages?
    I found plugins for taxonomies handling. I could create a new taxonomy for Pages, fill it with the same 53 name and search by name into this taxonomy the categories of the current post.But this solution is weak: if the name of a nation is written different I loose the connection. The same problem if I use tags instead of categories in posts and Pages. Moreover, authors could make a mistake typing the tag.

    The optimal solution would be to create a taxonomy to be used for both posts and pages.
    But all plugins I found create a taxonomy for either posts or Pages.
    Any other idea? Maybe basing all on categories (or taxonomies) is not the right way? Maybe I need to organize all as a CMS, and use heavily pages for content navigation?

    Sorry for the long post. Any suggestion is very appreciated.
    Bye

  2. Dodo67
    Member
    Posted 5 years ago #

    Found a solution in the meanwhile. :-)
    Using custom_taxonomy plugin and setting a new taxonomy 'Nations' for pages, the terms in this new taxonomy are shared with standard 'category' terms if the names are the same.
    So now it's possible to 'correlate' posts with Pages using categories id.

  3. bluebird2
    Member
    Posted 4 years ago #

    Would you leave a link here to your site so we can see how it works?

Topic Closed

This topic has been closed to new replies.

About this Topic