How to order posts by meta_value created inside loop?

In your WP_Query, only return ids. https://developer.wordpress.org/reference/classes/wp_query/#return-fields-parameter Create an empty array, $myArray = array();. Then loop thru the results of the query, $your_query->posts and fetch your field value for each id and add the result and the id to a new array in $myArray. Then sort the arrays in $myArray by the price. Then do … Read more

WordPress Loop – Not returning projects in specific category

You’re sure that you have actual posts (project post type), that have that category selected on them, right? Make sure the posts have an actual category selected, not a tag. Also check in the categories configuration to make sure that websites is the actual slug of the category they are assigned to. You can also … Read more

Breaking the loop?

I don’t think i’ve fully grasped how you want this to work, but if i assume for a moment that as long as the loop has at least 6 posts, you want to insert extra markup after the third result in the loop.. Example Insert extra markup after the third post, when the current iteration … Read more

I’ve been out of the loop since 2.8. What did I miss?

In no particular order, other notable things are: old default theme was deprecated in favor of annual theme changes, you jumped over Twenty Ten theme and current one is Twenty Eleven WordPress MU was merged into mainline WordPress and is now called multisite feature serious improvements to complex querying by taxonomies and custom fields server … Read more

Single page site (WordPress) including posts

To include posts and pages in the loop, use the ‘post_type’ argument: <?php $wp_query = new WP_Query(); $args = array( ‘post_type’ => array(‘post’,’page’) ); $wp_query->query($args); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php the_content(); ?> <?php endwhile; ?> http://codex.wordpress.org/Class_Reference/WP_Query

Running a loop with a custom query string on a custom page template

You should remove $query_string from the template. the Quesry string contains params specific to your page… your loop should look like this: <?php query_posts(“posts_per_page=10&cat=3&orderby=asc&paged=”.get_query_var(‘paged’)); if (have_posts()): while(have_posts()): the_post(); <!– your custom data here –> the_title(); the_content(); endwhile; endif; ?>

wp alchemy multiple image uploader output images to template

Do you have any output code we can reference? Put this in your Theme file: <img src=”https://wordpress.stackexchange.com/questions/45576/<?php get_the_value(“imgurl’); ?>” style=”width:100px;height:100px” /> if you have multiple you’ll have to go through a foreach loop: <?php foreach ($meta[‘imgurl’] as $img ) { echo ‘<a href=”#” /><img src=”‘. $img .'” /></a>’; } ?> Hope this helps, I don’t … Read more

Targeting a Certain Post in Loop (CSS)

They key is here: <li <?php post_class(); ?> id=”post-<?php the_ID(); ?>”> You can add a parameter to the post_class call, e.g.: $counter = 0; $custom_query = new WP_Query(‘cat=2687&posts_per_page=3’); //Top of the page – Top Photo Category while($custom_query->have_posts()) : $custom_query->the_post(); $counter++; $column = $counter %3; // 3 columns, use module to get the remainder $class = … Read more

Displaying the last page of posts

Is it possible to load in the last page of posts first? Order DESC instead of ASC and make use of the posts_clauses filter. function wpse_59557_order_desc( $pieces ) { // Add conditionals here and abort in cases, where we don’t want this, for e.g.: // if ( ! is_home() OR ! is_front_page() ) return; // … Read more

the_excerpt not showing posts

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/60224/<?php the_permalink(); ?>”><?php the_title(); ?></a> <?php the_excerpt() ?> <?php endwhile; else: ?> <p>Nothing to see here.</p> <?php endif; ?> This is the right syntax to show title and the excerpt on home page.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)