Randomly placed sticky custom posts complemented by blog posts

This did it: $products = get_posts(array(‘post_type’ => ‘products’)); $numbers = range(0, 8); shuffle($numbers); $x = 0; foreach($products as $post) : setup_postdata($post); $product = new WP_Query(array(‘p’=>$post->ID,’post_type’=>’products’)); if (!empty($product->posts)) array_splice($posts,$numbers[$x],0,$product->posts); $x++; endforeach; foreach($posts as $post) : setup_postdata($post); …

Custom Taxonomy terms with latest post ordered by date pagination issue

to change the number of posts per page you can do it in the wp dashboard like in this picture This function on functions.php works for me function tcPostsPerPage( $query ) { if (is_home()){$query->set(‘posts_per_page’, 6);} if (is_archive()){$query->set(‘posts_per_page’, 6);} } add_action( ‘pre_get_posts’, ‘tcPostsPerPage’ ); the two 6 is limiting to 6 per page, if this doest … Read more

List taxonomy terms plus their latest post ordered by post date

Right now you are performing the query by term, and displaying results instantly. What you need is to gather the results of each query, sort them and then display separately. Make sure to read code comments. /* $custom_terms = get_terms(‘columna’); – this approach is depreciated */ $custom_terms = get_terms( array( ‘taxonomy’ => ‘columna’ ) ); … Read more

Contact Form 7 – Populating dropdown list with terms relative to the post

Use the dynamic_dropdown tag functionality offered by the Smart Grid layout extension. The dynamic tag can take 3 sources of data (a given taxonomy, or branch within that taxonomy, a list of post titles, or the results of a filtered hook function). Use the filter hook to populated your dropdown as, add_filter(‘cf7sg_dynamic_dropdown_custom_options’, ‘filter_options’,10,3); function filter_options($options, … Read more

Problem with query_posts for a custom taxonomy in theme options

I see three things. if ( function_exists( ‘of_get_option’ ) ) : query_posts( ‘cat=” . $homepage_feature = of_get_option( “homepage_feature’ ) . ‘&posts_per_page=3’ ); You have a syntax error. There is no endif;. Maybe that is a typo, but maybe not. If you are trying to write a one-line if, remove the colon. Your title states “custom … Read more