Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #519305

    Hi Enfold team,
    I have an issue using the Avia Advanced Editor.
    I would like to filter posts based on category ‘private’.
    I copied the single.php file in my child theme folder.
    I added this code around the loop:

    if ( in_category('private') && !is_user_logged_in() ) {
    						
    						get_template_part( 'includes/private' );
    
                         } else {
                        /* Run the loop to output the posts.
                        * If you want to overload this in a child theme then include a file
                        * called loop-index.php and that will be used instead.
                        *
                        */
    
                            get_template_part( 'includes/loop', 'index' );
    						
                            //show related posts based on tags if there are any
                            get_template_part( 'includes/related-posts');
    
                            //wordpress function that loads the comments template "comments.php"
                            comments_template();
                         }

    and I created a file private.php in ‘include’ folder with custom code inside.
    Everything is fine, until the post uses Basic Editor, but when I switch to Advanced Editor, it seems that single.php is no more used as template.

    Thank you for your help.
    Riccardo

    #519462

    Hi Mercheric!

    If your using the layout builder then the file your wanting is /enfold/template-builder.php.

    Best regards,
    Elliott

    #519709

    Elliott: T H A N K Y O U !
    it works.

    Riccardo

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Custom post template based on a single category’ is closed to new replies.