WordPress.org

Support

Support » Plugins and Hacks » Hacks » PHP Help: Menu to show all posts from a category, but…

PHP Help: Menu to show all posts from a category, but…

  • jimjiminy
    Member

    @jimjiminy

    Hello.

    First post so apologies for any mistakes. I’ve looked hard for a solution and tried a few alternatives including child categories that caused unwanted behaviour elsewhere on my site in question.

    I’m trying to display a menu that will:

      – display posts from a category in a ul
      – show those post titles as links to the post
      – title the menu with the category
      – (optional but WIN) exclude the current post from the list

    This is how they should look in the menu under the_title() and the_excerpt() (bottom left – currently hardcoded to look for this particular category, but there are and will be several more).

    My problem is that some of the posts have two categories: ‘Projects’, and a project category. The category ‘projects’ enables posts to be listed in a project menu page like this.

    If I try to show a list of category posts, posts before ‘P’ seem to work ok, but ones after just use the category ‘projects’. Beside that, the only thing I can get to display is the caetgory title using get_category().

    As with most people who ask for help, I’m no PHP coder. I’ve found a few lines that do one aspect of the job, but hacking them together hasn’t been successful sadly. PHP syntax confuses the hell out of me.

    I’d love to use a plugin, but the people using the site won’t have a clue how to create a category menu plugin for each new project category they create (I’d use Widget Logic to show/hide per category if that was the case).

    Sorry for the lengthy question. Can anyone help? Have I been in any way clear?

  • The topic ‘PHP Help: Menu to show all posts from a category, but…’ is closed to new replies.