Forums

Linking to a Taxonomy Category (2 posts)

  1. sydneywebsites
    Member
    Posted 3 months ago #

    If you go to my homepage:

    https://ivyvintage.com/ and under the "Latest Photos" there are some thumbnails. When someone clicks on the image I want them to go to the category of the images post. So for example when someone clicks on the purply coloured shoes I want the link to go to:
    https://ivyvintage.com/gallery-category/shoes/

    and when clicking on the handbag go to:
    https://ivyvintage.com/gallery-category/handbags/

    this is what the code looks like to generate the images at the moment:

  2. <img src="<?php echo $recent_project_thumb[0]; ?>" alt="<?php the_title(); ?>" width="162" height="100" class="imgstyle" />
  3. Obviously I need to put something in the href section and I have tried everything with no luck. The posts belong to a taxonomy category, this is what functions.php looks like:

    register_taxonomy('gallery_cats','gallery',array(
    'hierarchical' => true,
    'labels' => $cat_labels,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'gallery-category' ),
    ));

    I would really appreciate your help, thank you!

  • sydneywebsites
    Member
    Posted 3 months ago #

    If you go to my homepage:

    https://ivyvintage.com/ and under the "Latest Photos" there are some thumbnails. When someone clicks on the image I want them to go to the category of the images post. So for example when someone clicks on the purply coloured shoes I want the link to go to:
    https://ivyvintage.com/gallery-category/shoes/

    and when clicking on the handbag go to:
    https://ivyvintage.com/gallery-category/handbags/

    this is what the code looks like to generate the images at the moment:

    <li><a href="https://ivyvintage.com/gallery-category/"><img src="<?php echo $recent_project_thumb[0]; ?>" alt="<?php the_title(); ?>" width="162" height="100" class="imgstyle" /></a></li>

    Obviously I need to put something in the href section and I have tried everything with no luck. The posts belong to a taxonomy category, this is what functions.php looks like:

    register_taxonomy('gallery_cats','gallery',array(
    		'hierarchical' => true,
    		'labels' => $cat_labels,
    		'query_var' => true,
    		'rewrite' => array( 'slug' => 'gallery-category' ),
    	));

    I would really appreciate your help, thank you!

  • Reply

    You must log in to post.

    About this Topic

    Tags