Display post from custom post type

You need to add ‘post_type’ => array(‘post’, ‘opinion’) to your $normal_args array and maybe remove the meta_query?. Are you sure you have any opinions with a _custom_blog_enhome of 1? Start from $normal_args = array( ‘post_type’ => ‘opinions’, ‘post_status’ => ‘publish’ ); and add arguments one by one and watch the results.

toggle Multiple Loop with tittle

Based on the comments, you should be able to do something like the following: Create a custom taxonomy to hold your Temporadora items in (e.g. Temporadora 1) Create a custom post type to hold your episodes Create a relationship between the two From there, it should be a matter of doing something like the following: … Read more

add_action in the loop hooks

Once a fucntion has been hooked to an action, the function will be executed every time the action is called (with do_action). To stop this, the action should be removed. See remove_action: function do_entry() { if ( get_the_title() ) { add_action(‘loop_entry_before’, ‘function_that_adds_h2_structure’); } else { remove_action(‘loop_entry_before’, ‘function_that_adds_h2_structure’); } add_action(‘loop_entry_entry’, ‘function_that_adds_content_structure’); } In your case, I … Read more

Query Taxonomy By Page Title

If you don’t define the field in the array then it defaults to ID. Your options are term_id, name and slug: http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters ‘tax_query’ => array( array( ‘taxonomy’ => ‘language’, ‘field’ => ‘name’, ‘terms’ => get_the_title() ) )

How to Generate a list of Most Commented post?

Primary issue with your function is “get_template_part” internally use global $post variable to display the post fields. However, your $post variable is filled for this function only. I would suggest to read this handy article Displaying Posts Using a Custom Select Query Now, specifically in your case function lugaresincreibles_most_commented() { global $wpdb, $post; // make … Read more

Multiple Loops on a Page Without Duplicates

Is there a reason to execute the query in each individual div instead of looping the div within the query? <?php $my_query = new WP_Query( ‘post_type=portfolio&showposts=13’ ); while ( $my_query->have_posts() ) : $my_query->the_post(); ?> <div class=”port1″> <?php the_title(); ?> </div> <?php endwhile; ?> If you want to number the divs sequentially, you can use a … Read more