Title: php template
Last modified: September 14, 2019

---

# php template

 *  Resolved [Matteo Legittimo](https://wordpress.org/support/users/mattleg/)
 * (@mattleg)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-template-3/)
 * Hello, i remember that it was possible to put a file named “custom-post-widget.
   php” in theme folder for filter the content for example by id
 * Is it not possible anymore?
    Thanks

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

 *  Plugin Author [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-template-3/#post-11933354)
 * Hi Matteo,
 * This functionality is still in the plugin, what issue are you experiencing with
   it?
 *  Thread Starter [Matteo Legittimo](https://wordpress.org/support/users/mattleg/)
 * (@mattleg)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-template-3/#post-11933492)
 * Ciao Johan,
    this is the content of my “custom-post-widget.php” in my theme folder:
 *     ```
       if ( !$apply_content_filters ) { // Don't apply the content filter if checkbox selected
       	$content = apply_filters( 'the_content', $content);
       }
       echo $before_widget;
       $id = $content_post -> ID;
       echo 'this is the id:'.$id;
       if ($id == 60) {
           include( get_stylesheet_directory() ."/custom-post-widget-candidatura.php");
       } else {
   
       	if ( $show_custom_post_title ) {
       		echo $before_title;
       		echo apply_filters( 'widget_title',$content_post->post_title);
       		if ( $show_featured_image ) {
       			echo get_the_post_thumbnail( $content_post -> ID );
       		}
       		echo $after_title;
       	}
       	echo do_shortcode( $content );
       }
       echo $after_widget;
       ```
   
 * and using php shortcode to include in my page:
 *     ```
       echo do_shortcode('[content_block id="60"]')
       ```
   
 * but cant see neither the echo “this is the id”, like is not reading the file “
   custom-post-widget.php”
 * Thanks
 *  Plugin Author [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-template-3/#post-11935637)
 * You will have to disable the content filters in your shortcode, or it will skip
   the first if statement where you made your modifications.
 * Alternatively, you can try echoing something after the line
 * `echo do_shortcode( $content );`

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

The topic ‘php template’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-widget/assets/icon.svg?rev=2884166)
 * [Content Blocks (Custom Post Widget)](https://wordpress.org/plugins/custom-post-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-widget/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/php-template-3/#post-11935637)
 * Status: resolved