Support » Fixing WordPress » How can I display page categories in widget?

  • Hello!

    The link I used in the top is to a website with a feature i’m trying to replicate. If you scroll down the page and look to the right you will see “Project Details”

    I’m currently using WP Portfolio and I want to imitate a Project Details tab into my portfolio items. Does anyone know how to begin this process? I’m willing to learn how to do it just dont know which direction to head.

    I also want to format the pages like website.com/portfolio/category/item

    Any help or ideas would be wonderful THANKS! >:)

    • This topic was modified 2 years, 6 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You would need to alter the template used to display a portfolio item. When you alter templates, it’s best to create a child theme to contain altered or custom templates. In the template code, you get the categories with wp_get_post_categories(). If the taxonomy is not the actual “category” taxonomy, specify the correct one as part of $args. If all you need is the actual term names, you can limit what data is returned with the “fields” argument, also part of $args.

    The function returns an array of category or term items. If all you got were names, you can implode() the array elements into a string ready for output. Otherwise loop through the array and extract the data you want for output.

    If you want a custom permalink structure to be recognized, use add_rewrite_rule() to cause WP to recognize it and properly rewrite it internally into a form WP can understand as an URL query string..

    Thread Starter austinsuch

    (@austinsuch)

    Is there a plugin I can just download? I am having trouble finding the right code to use, also having issues trying to find out the names of everything. I dont know what I’m doing TBH

    Moderator bcworkz

    (@bcworkz)

    I’m not aware of one. It doesn’t mean one does not exist. You might try asking in your theme’s dedicated support forum. Maybe someone there has a suggestion.
    https://wordpress.org/support/theme/wp-portfolio/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I display page categories in widget?’ is closed to new replies.