Sidebar on single.php not showing up

It seems that the sidebar checks whether or not the Post Layout is set to “content”. If you remove that check, it should operate the way the main index page does. Editing / commenting out the following lines in sidebar.php should solve the problem (if not, get you closer): Find: if ( ‘content’ != $current_layout … Read more

Unable to paginate a custom page query

The problem was in the same name for category slug “categories” and the same for the custom page that was holding all categories with the same name “categories”. I have solved that by changing categories slug (in permalinks settings) to singular “category” and I have left custom page as plural “categories”. If somebody know about … Read more

Displaying year once in category.php [duplicate]

Create your query for the category, and order by date $q = new WP_Query(‘category_name=acategory&orderby=date&order=DESC’); After that, while looping posts, save the year in a helper variable, shoing it only when changed: $year = 0; if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); $post_year = (int) get_the_time(‘Y’); if ( $post_year !== (int) $year … Read more

Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]

I was able to find the solution. This is so simple and I can’t believe I did not just do this first, but there you are (duh), I thought it was more complex than that… My solution is below: Copy woocommerce template to my theme to override single-product/add-to-cart/variable.php editing variables.php, change the <?php echo esc_url( … Read more

How to create a archive template for custom post type [duplicate]

Try this: <?php while($article_posts->have_posts()) : $article_posts->the_post(); ?> <tr> <td><a href=”https://wordpress.stackexchange.com/questions/131769/<?php the_permalink(); // <– Here”s the post url ?>”><?php the_title(); ?></a></td> <td><?php the_field(‘published_in’); ?></td> <td><?php the_field(‘article_author’); ?></td> <td><?php the_field(‘published_date’); ?></td> </tr> <?php endwhile; ?>