• Resolved junkes

    (@junkes)


    Hey,

    I’m using Auto Template in my CPT and a Pod’s template to substitute the_content hook (singular and list). The thing is, I want to display the post_content field (the same one we get from @post_content in Pod’s template) of that CPT in a PHP search template but if I use the_content(); or field=post_content I only get the Pod’s template.

    Is there a easy way to bypass that?

Viewing 1 replies (of 1 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @junkes

    That is the whole idea of auto templates. If you don’t want to have the post content replaced then you should turn off auto-templates for that post type.
    The search template should be the same as the list template in this case.

    You could also use filters to bypass auto-templates in some cases.
    Something like this:

    
    add_filter( 'pods_auto_template_template_name', function( $name ) {
        if ( is_search() ) {
            $name = ''; // Remove selected template when on a search page.
        }
        return $name;
    } ); 
    

    Cheers, Jory

Viewing 1 replies (of 1 total)
  • The topic ‘Displaying CPT post_content on PHP template’ is closed to new replies.