Showing the category hierarchy as clicked in WordPress, with image and desc
Showing the category hierarchy as clicked in WordPress, with image and desc
Showing the category hierarchy as clicked in WordPress, with image and desc
Ok, you were basically almost there, all you had to do was output the slug value in two places in the sprint(). Answer edited/added to: <ul class=”accordion”> <?php $categories = get_categories( array( ‘orderby’ => ‘name’, ‘order’ => ‘DESC’, ‘offset’ => 1 ) ); $cat_array = array(); foreach( $categories as $category ) { $category_link = sprintf( … Read more
Remove WP Core canonical for category pagination
Yes, you can use shortcodes. Follow this link: https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-9
You can you just simply put this code into your singl.php foreach((get_the_category()) as $category) { echo $category->cat_name . ‘ ‘; }
Your code will work, I would clean it up a bit, so in case we have no categories (say, it’s a page, not post), meta tag won’t appear at all… Depending on theme it could be “header.php” or “head.php” (or something else… look for closing tag). Another option is adding it as a hook, but … Read more
Can a Woocommerce product category URL contain “&”?
Can you try: <?php if (have_posts()): ?> <?php while (have_posts()): the_post(); ?> <?php $categories = get_the_category(); $listCategories = []; foreach ($categories as $category) { $listCategories[] = $category->slug; } ?> <!– Isotope Grid-Item –> <div class=”col-md-3 col-sm-4 col-xs-12 isotope-grid-item <?php echo implode(‘ ‘, $listCategories); ?>” data-category=”<?php echo implode(‘,’, $listCategories); ?>”> <div class=”isotope-item”> <a href=”#”> <div class=”isotope-feature-image”><?php … Read more
You’re not opening and closing the if statement correctly, so the div is always being output. While you can use if statements without the opening and closing parts like this if there’s only one line of code, that doesn’t work if the PHP tags are closed for HTML. So you need to have this: <?php … Read more
Use has_term() to determine if a post has a specific term. <?php if ( has_term( ‘Members’, ‘portfolio_category’ ) ) : ?> <!– Output icon here. –> <?php endif; ?>