Thread Starter
Chef
(@splendidangst)
This is what’s happening when I attach a featured image to my product (which I need for the main product page to show the thumbnail)
http://www.vunewhall.com/store/products/test-product-1/
What it looks like elsewhere on the site
(images haven’t been updated)
http://www.vunewhall.com/band-registration-form/
What I want things to look like in the /store
http://www.vunewhall.com/category/bands/
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Need you use PHP, opposing CSS?
Thread Starter
Chef
(@splendidangst)
I could use display none but that doesn’t help in using conditional tags.
I used this once in my template and it worked out well for me. I would retrieve the page name or post name and decide based on this what to show…
$pageslug = $post->post_name; // name of the page (slug) or post
$catslug = get_category_by_slug($pageslug); // get category of the same slug
$catid = $catslug->term_id; // get id of this category
$query= 'cat=' . $catid. ''; //Get the cat
query_posts($query); // run a query if you so wish
//For example here am testing for the contact us page - can't recall if it worked with default or pretty permalinks may be try both
//this can also test for $catslug i.e category
if (!($pageslug == "contact-us")){
//Do my stuff here based on the slug test
}?>
Thread Starter
Chef
(@splendidangst)
I will try this in the morning and let you know how it worked. Hopefully MarketPress uses “store” as a category and not just a dir link