Insert PHP Code to the wordpress post/pages

a good plugin – especially if you use visual composer, but want to do custom query at the page.

Insert PHP Code Snippet

Sample code to display custom query

query_posts('post_type=gallery&order=DESC');?>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
     <li>
          <a href="<?php the_permalink();?>"><?php the_title(); ?></a>
     </li>
<?php endwhile; else: ?>

<?php endif; ?>
<?php wp_reset_query(); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *