How to move image thumbnails into custom folder for custom post type

Use bellow filter in the functions.php <?php add_filter( ‘upload_dir’, function($args) { if( !isset($_REQUEST[‘post_id’]) ) { return $args; } $post_type_name = get_post_type( $_REQUEST[‘post_id’] ); if( $post_type_name=”custom_post_type” ) { // Set the new path depends on current post_type $newdir=”https://wordpress.stackexchange.com/” . $post_type_name; $args[‘path’] = str_replace( $args[‘subdir’], ”, $args[‘path’] ); //remove default subdir $args[‘url’] = str_replace( $args[‘subdir’], ”, $args[‘url’] … Read more

Is it possible to show full content of the post when there is only one post in a grid?

not sure how you’re actually displaying your posts whether it’s a custom query and which page your doing your grid, for example a category page. Here’s a little snippet that may help you. //get current category page $category = get_the_category(); //get current category page ID $category_id = $category->cat_ID; //set arguments for your desired posts output … Read more

Linking to the most recent post in a Custom Post Type

As long as Pods creates standard custom post types, you can simply update the arguments passed to WP_Query . The$post_type parameter will allow you to filter the results based on the specified post type (string) or post types (array). $latest = new WP_Query( array( ‘category_name’ => $request->query_vars[‘category_name’], ‘posts_per_page’ => 1, ‘post_type’ => array ( ‘post’, … Read more

How to Display child post on his parent post with thumbnail and content in WordPress

Just to check I understood your question, you want to display child posts under each parent post? In that case you have to write one more WP_Query inside your while loop, with parent as current post in loop. Something like: if ($query->have_posts()) : ?> <?php while ($query->have_posts()) : $query->the_post(); ?> <div class=”col-md-3 col-sm-6 wow fadeInRight”> … Read more