Quantcast
Channel: Clan VPS Host » loops
Browsing all 26 articles
Browse latest View live

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 Article


Looping 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 Article


Php 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 Article

Display 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 Article

How 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 Article


How 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 Article

Display 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 Article

ACF / 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 Article


Echo 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 Article


Limit 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 Article

WordPress 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 Article

Infinite 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 Article

why 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 Article


WordPress: 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 Article

How 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 Article


WordPress 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 Article

WordPress 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 Article


WordPress 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 Article

WordPress 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 Article

How 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
Browsing all 26 articles
Browse latest View live