Need to while loop and display contents in the subfield of a group field given by ACF
Need to while loop and display contents in the subfield of a group field given by ACF
Need to while loop and display contents in the subfield of a group field given by ACF
Those parameters are optional, as the codex states: $post_type (string) (optional) Post type to count the number of posts for. Default: “post” So it’s optional, not required. If it isn’t passed in, then the default value is “post”. Optional parameters are a part of PHP, e.g. function print_number( $number=5 ) { echo $number; } print_number( … Read more
get_page_by_title not working inside fucntions.php
get_terms() creates a WP_Term_Query() and then passed the $args to it. It also applies the get_terms filter to the terms before they’re returned. get_terms() is, in this case, a convenience function, to use if you don’t need all the bells and whistles a WP_Term_Query might provide. As far as the_title() and the_permalink(), those functions are … Read more
if anyone else is having the same problem as me, here is the solution. The problem that was causing this was <?php echo get_permalink(the_post()); ?> Honestly, I have no idea why I went with this instead of just the_permalink() , was having a problem with my read more button it was sending me to a … Read more
I have found your issue and it is “section” tag. You have written “section” tag inside the while loop. so it must need put “section” tag outside of the while loop and check it again. Hope it’s works fine.
I’m a fool. I just noticed I’m trying to use content-post when I changed it to just content. All working now. Sorry.
If you’re on a tags archive would the $current_term not be the tag? rather than the category? a post can be in multiple categories so which category should it pull the image from? or are you associating images with each tag as well as each category and you want the image associated with that tag? … Read more
The root problem here is a missing endif; on the second loop. But, there are a few changes we can make to improve this and make things work, this loop, will work a lot better: <h3>Other standards</h3> <div class=”row”> <div class=”col-12″> <?php $query = new WP_Query( [ ‘post_type’ => ‘page’, ‘post_parent’ => 27, ‘posts_per_page’ => … Read more
Your final outlook is a bit tricky to achieve using traditional way. Lets assume both category has at least 6 post. Now first grab the posts using get_posts() not WP_Query $side_news = get_posts(array( ‘post_type’ => ‘post’, ‘category_name’ => ‘category-slug-1’, ‘posts_per_page’ => 6 )); $side_news2 = get_posts(array( ‘post_type’ => ‘post’, ‘category_name’ => ‘category-slug-2’, ‘posts_per_page’ => 6 … Read more