Support

Account

Home Forums General Issues How to show category information on single post Reply To: How to show category information on single post

  • I completely forgot to give an example of what I’m trying to achieve. So if the article is about a film for example, let’s say Casablanca, I want the sidebar to have generic information that I filled out in the category creation like an image of a DVD cover for Casablanca and I want that to be true of all articles I write about Casablanca. This code should grab that image right?

    <?php $prodimage = get_field( 'prodimage' ); ?>
    <?php if ( $prodimage ) { ?>
    	<img src="<?php echo $prodimage['url']; ?>" alt="<?php echo $prodimage['alt']; ?>" />
    <?php } ?>

    I don’t know how to only pull the prodimage for the category of the post like the following code that pulls in the worpdress category description for the post:

    <?php $catID = get_the_category(); echo category_description( $catID[0] ); ?>