How to do a loop inside a loop?

What if you save each query in a variable ? <ul> <?php $query1 = query_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => array(‘specialties’) )); if($query1->have_posts()): while($query1->have_posts()): $query1->the_post(); ?> <li> <!– title from post type specialties –> <p><?php the_title(); ?></p> <ul> <?php $query2 = query_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => array(‘team’) )); if($query2->have_posts()): while($query2->have_posts()): $query2->the_post(); ?> … Read more

Create taxonomy from Custom Post Type

Very Simple Code Snippet for Creating Taxonomy for Custom Post Type Register Custom Post Type function Knowledge_base_init() { $labels = array( ‘name’ => _x( ‘Knowledge bases’, ‘post type general name’, ‘your-plugin-textdomain’ ), ‘singular_name’ => _x( ‘Knowledge base’, ‘post type singular name’, ‘your-plugin-textdomain’ ), ‘menu_name’ => _x( ‘Knowledge bases’, ‘admin menu’, ‘your-plugin-textdomain’ ), ‘name_admin_bar’ => _x( … Read more

Varnish + Nginx for WordPress is Good?

Yes, it is good, but other options are also good. There is no silver bullet in term of webservers and caching software, if there was everybody would have been using the same tools. It depends both on what are your actual needs and how comfortable are you with managing the tools. For example it might … Read more

Load php function with AJAX on modal window

You can’t directly use sendTrailer.php ,wordpress can’t find this custom page directly so you have to specify fully path of that page using get_template_directory() In your ajax function write url : ‘<?php echo get_template_directory(); ?>/sendTrailer.php’

How to display page content and a list of posts on the same page?

php file add the following code snippet <?php get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php the_title( ‘<h1>’, ‘</h1>’ ); ?> <?php the_content(); ?> <?php endwhile; // end of the loop. ?> <?php $post = array( ‘post_type’ => ‘post’, ‘order’ => ‘ASC’, ‘post_status’ => ‘publish’ ); $loop = new WP_Query( $post ); … Read more