• Resolved twinstar1

    (@twinstar1)


    Hi all,
    First up, the link above may not work as I am building the new website on server and using Host File to force dns. If this is an issue, please let me know. Just not sure if it is cool to put the IP address on here?

    Anyway, my problem is that I need the Portfolio Category Description to display on the Portfolio Category Page in the front end. (Mine is actually called ‘Product Category’ but that should not matter).

    So I have spent the past week talking to the Theme Developer (Ronneby), who won’t give me an answer. I have read every WordPress forum on the web and got nowhere.
    Most forums are of course saying this is really simple and all I need to do is add some code like this;

    <?php 
    the_archive_description( '<div class="taxonomy-description">', '</div>' ); 
    ?>

    or this;

    <?php echo category_description( $category_id ); ?>

    …to my archive.php or category_php file, and all will be well.

    Well it isn’t.
    I have tried following instructions such as this;
    https://www.wpbeginner.com/wp-tutorials/how-to-display-category-descriptions-in-wordpress/
    But they are not working and don’t really make a lot of sense anyway as I just want to enable the description, not place it in weird and wonderful locations on my website.

    I know this has to be easier than the Github nerds are making it out to be, so please can someone help me out with a straight forward answer as to how I make the portfolio category description show up in the front end archive page.

    Thanks in advance.

    • This topic was modified 4 years, 3 months ago by twinstar1.

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

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

    (@bcworkz)

    You’re having trouble because it’s for a custom taxonomy term. The term’s description is part of the WP_Term class properties. The requested term’s object can be had with get_queried_object(). You might want to create a template specific for your taxonomy term archive. Start with a copy of archive.php template and name it taxonomy-products-category.php. It’ll only be used for terms within products-category.

    On that template where you want the description to appear add:
    <?php echo esc_html( get_queried_object()->description ); ?>
    You’ll want to wrap this output in a div with a certain class so it can be styled easier.

    Thread Starter twinstar1

    (@twinstar1)

    Thanks bcworkz, will give it a go.

    Hi,

    Did this fix your problem?

    If your question has been answered, we would love if you would mark this topic as resolved in the sidebar. This helps our volunteers find the topics that still need attention and more people will get helped, possibly like you did.

    Thread Starter twinstar1

    (@twinstar1)

    Hey Daniel,
    I have now resolved the issue, but I did not attempt the advice give by bcworkz. Not that there was anything wrong with that advice and it is greatly appreciated, but the Ronneby team finally responded to me with a nice easy copy paste code solution.

    Big thanks to bcworkz for offering assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘display portfolio category description’ is closed to new replies.