how to grab shortcode from custom post type

Solutions on MaxInterview for how to grab shortcode from custom post type by the best coders in the world

showing results for - "how to grab shortcode from custom post type"
Wassim
12 Nov 2020
1function diwp_create_shortcode_movies_post_type(){
2 
3    $args = array(
4                    'post_type'      => 'movies',
5                    'posts_per_page' => '10',
6                    'publish_status' => 'published',
7                 );
8 
9    $query = new WP_Query($args);
10 
11    if($query->have_posts()) :
12 
13        while($query->have_posts()) :
14 
15            $query->the_post() ;
16                     
17        $result .= '<div class="movie-item">';
18        $result .= '<div class="movie-poster">' . get_the_post_thumbnail() . '</div>';
19        $result .= '<div class="movie-name">' . get_the_title() . '</div>';
20        $result .= '<div class="movie-desc">' . get_the_content() . '</div>'; 
21        $result .= '</div>';
22 
23        endwhile;
24 
25        wp_reset_postdata();
26 
27    endif;    
28 
29    return $result;            
30}
31 
32add_shortcode( 'movies-list', 'diwp_create_shortcode_movies_post_type' ); 
33
Esteban
11 Feb 2016
1<?php apply_filters('the_content',get_the_content( $more_link_text, 
2 $stripteaser, $more_file )) ?>
3
queries leading to this page
shortcode new post wordpressshortcode to display custom post typecreate a shortcode for your custom post typecustom post type category shortcodeshortcode support custom post typehow make shortcode of custom post type in wordpresshow to shortcode show and genrate in post typecreate new post wordpress shortcodecreate shortcode for custom post type ro show a catewgory wordpresswp custom post type shortcode plugindisplay custom post type with shortcodecreate shortcode for custom post type wordpressdisplay custom post type using shortcodehow to show custom post using shortcodedisplay custom post type by category using shortcodecreate shortcode to display custom post type by categorycustom post type show shortcodeshortcode add new post link wordpresswp add shortcode for custom post typecustom post type shortcodecreate custom post type shortcodehow to grab shortcode from custom post typedisplay posts shortcode custom post typehow to find the post type to attach shortcodehow to create shortcode in wordpress for custom post typewp custom shortcodehow to shortcode show in custom post typewp custom post type shortcodecreate shortcode of custom post typedisplay custom posts in shortcode wpshortcode for specific custom post type posthow to query custom type post in wordpress using shortcodepost type shortcode with attributespost type post shortcode wordpresscustom post type shortcode generatorcreate shortcode for custom post typeadd shortcode for specific post typeget post by custom shortcode by idshortcode add new post wordpresscustom post type with shortcodehow to create shortcode for custom post type page in wordpresscreate shortcode to display custom post type with categoryget custom post type shortcodeshortcode custom post type wppost shortcode custom generateshortcode to grab custom post typewordpress shortcode query custom post typecustom post type shortcodesadd shortcode to wordpress postget the current post type inside shortcodehow to create shortcode for custom post type to display postswp shortcode for postscreate shortcode for custom post type different pagehow to create a custom shortcode for post type in wordpressscreate shortcode for post in custom post typehow to create shortcode for custom post type in wordpressshortcode display custom post typecreate shortcode for specific posthow to grab shortcode from custom post type