Title: Getting the shortcode from a post query
Last modified: September 25, 2022

---

# Getting the shortcode from a post query

 *  Resolved [nilssondigital](https://wordpress.org/support/users/nilssondigital/)
 * (@nilssondigital)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/getting-the-shortcode-from-a-post-query/)
 * Hi,
 * I’m trying to set up a custom page that uses the wordpress loop to query the 
   dflip post type, so that I can have a page that just lists all the ebooks as 
   they’re added to the site.
 * Query is simple and looks like this
 *     ```
       <?php 
   
                   // The Query
   
                   $args = array('post_type' => 'dflip',
                                 'posts_per_page' => '1000',
                                );
   
                   $the_query = new WP_Query($args);
   
                   if ( $the_query->have_posts() ) :  
                      while ( $the_query->have_posts() ) : $the_query->the_post();  ?>
   
       				<div class="item ebook">
                                        <div class="shortcode">
                                           <?php do_shortcode(''); ?>
                                        </div>
                                       </div>
       ```
   
 * I’m just trying to figure out how I can grab the shortcode here?
 * Is that possible?
 * No need to modify the code or anything it’s just there to explainwhat I want 
   to do, I just don’t know how to get the shortcode.
 * Thanks,
 * Chad

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [DearHive](https://wordpress.org/support/users/dearhive/)
 * (@dearhive)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/getting-the-shortcode-from-a-post-query/#post-16041031)
 * Hi,
    You don’t need to grab the shortcode. You just need to write the shortcode.
 * and just add id of the post accordingly.
    Even we do it that way.
 * But another way is to use
 * `[dflip books='all' limit='-1'][/dflip]`
 * this will also list all the books.
    [https://dearflip.com/docs/dearflip-wordpress/getting-started/create-flipbooks/#using-categories](https://dearflip.com/docs/dearflip-wordpress/getting-started/create-flipbooks/#using-categories)
 *  Thread Starter [nilssondigital](https://wordpress.org/support/users/nilssondigital/)
 * (@nilssondigital)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/getting-the-shortcode-from-a-post-query/#post-16041050)
 * [dflip books=’all’ limit=’-1′][/dflip] is exactly what I needed! Can’t believe
   I missed that!
 * Thank you!
 *  Thread Starter [nilssondigital](https://wordpress.org/support/users/nilssondigital/)
 * (@nilssondigital)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/getting-the-shortcode-from-a-post-query/#post-16041060)
 * Onnneee last question….is there any way I can modify the short code so that the
   title also displays below each thumbnail, instead of only on hover?
 *  Plugin Author [DearHive](https://wordpress.org/support/users/dearhive/)
 * (@dearhive)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/getting-the-shortcode-from-a-post-query/#post-16051993)
 * Hi,
 * Apologies, but, such customization is not available in the plugin.
 * Yet you can use your old PHP method and then create the shortcode and insert 
   a title below it.
 * Best Regards,
    DearHive

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Getting the shortcode from a post query’ is closed to new replies.

 * ![](https://ps.w.org/3d-flipbook-dflip-lite/assets/icon-128x128.gif?rev=3175518)
 * [DearFlip - PDF Flipbook, 3D Flipbook, PDF embed, PDF viewer](https://wordpress.org/plugins/3d-flipbook-dflip-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/3d-flipbook-dflip-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/3d-flipbook-dflip-lite/reviews/)

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 4 replies
 * 2 participants
 * Last reply from: [DearHive](https://wordpress.org/support/users/dearhive/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/getting-the-shortcode-from-a-post-query/#post-16051993)
 * Status: resolved