WordPress conditional loop on a single page
Situation: A page template contains pages with information about a topic and also runs a loop of posts about that topic – let's say: If is_page 'page1', show loop with tags about topic1 – If is_page...
View ArticleLooping Gif won't work on WordPress
I'm having an awful time trying to get something working for a client. Basically, I've created an animated looping gif which he wanted for his WordPress website, as a preloader thing. Now, I had...
View ArticlePhp array sum values with same key and send it to last row of php table in loop
I have this table : I want the last row Total: to display the sum of parcial values of all the users with the same name, for instance: debora fernandes global value should be 85 (50 + 35) im getting...
View ArticleDisplay posts where tag matches page title
I'm trying to create a loop that displays a list of posts with a tag that matches the page title that the loop is on. For example, I have a list of custom post types called 'countries' and within each...
View ArticleHow to create a loop inside wp_query wordpress function?
I want print array in a loop and want to put it inside wp_query. Is it Possible?If there are other alternatives kindly mention it. $wp_user_query = new WP_User_Query(array('role' => 'Subscriber',...
View ArticleHow to display content from AFC repeater field?
I have just begun using the ACF repeater field type to display a grid of projects on my site. The repeater field is named "projects" and I am using get sub field to display the content. However no...
View ArticleDisplay html.Div after nth post within WordPress loop
Using custom wordpress loop: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>//Post Content<?php endwhile;?>//Pagination<?php else : ?>//No posts message<?php...
View ArticleACF / PHP Repeater count
I have a repeater using Advanced Custom fields, which when a count reaches a total (of 3) based on an iterative count, I would like to output a div, then reset the counter. Here's the code, at the...
View ArticleEcho PHP variable under a WordPress custom Query
I have a custom field as an option, and I want to put the value of this option in a custom loop. So here's what I have: $CatTxt = the_field('section_1', 'option'); echo $CatTxt; This works, the problem...
View ArticleLimit posts per page after using array_merge in WordPress
I have two post types I want to display, Posts and then a Custom Post Type called 'Notes'. I want to query both of these and display them together. I've currently got it working using array_merge. I...
View ArticleWordPress looping over custom post type and printing out post title
I made a custom post type named sport, so I added a couple of sports and querried and printed them out like this: $sports = new WP_Query(array('post_type'=>'sport','posts_per_page' => -1,)); echo...
View ArticleInfinite loop. Why?
i wanna test if my variable is empty or not to display some differents things.When i don't use the else…if everything work but when i use this code : <?php $Amazon = get_post_meta($post->ID,...
View Articlewhy just geting 25 post?
i making a code to access to all post in wordpress, but i am just getting the last 25 posts and no more, this is the code $args = array( 'numberposts' => -1, 'post_type' => 'homeland_properties',...
View ArticleWordPress: How to display posts in a table using Bootstrap
I want to display my recent blog posts in this specific layout in WordPress. Here it is below: 1|2|3—–4|5|6 Here is my code so far….. <div class="container post_container"> <div...
View ArticleHow loop trough Custom Post Types and get their content in one page
I have some task which try to solve may be not in smartest way, but so far I got only this idea. I have 5 custom post types. In each of this – one post. Want these posts loop and appear on my index.php...
View ArticleWordPress PHP loop building custom slider
This is my first time posting on here. I've found this site very helpful in the post. I greatly appreciate the dedication the developers have to support each other. I'm building a testimonial slider in...
View ArticleWordPress loop order
I need to order the following wordpress loop by a custom field. Where can i set the order in this loop? <?php if ( $query->have_posts() ) { ?> <?phpwhile...
View ArticleWordPress masonry portfolio
I am creating a wordpress template with a portfolio page in masonry style. The images are retrieved successfully, but the end position is wrong. I just started learning php and do not understand where...
View ArticleWordPress Loop Tax Query with multiple terms
I have a taxonomy called "fachbereiche". First I load the taxonomies of the current page: <?php $term_list = wp_get_post_terms($post->ID, 'fachbereiche', array("fields" => "all", 'parent'...
View ArticleHow to hook in a custom query to the loop with WordPress
I want to create a loop and query posts by their author role. And display the results of a search term based on the authors role. I've tried creating a function to alter the query's where clause: $ids...
View Article