-
AuthorPosts
-
July 21, 2020 at 8:05 pm #1232082
Using child theme. The post is using Classic Editor. I added this code to single.php – basically asking single.php to use includes/trips.php rather than loop-index.php if post is in category saltwater or us-based but it does not recognize trips.php. To test I renamed trips.php to loop-index.php and it ran the file correctly. How do I get it to recognize trips.php? trips.php actually seemed to be working but I switched to advanced layout editor and then back to classic and now it doesn’t work.
<main class='content units <?php avia_layout_class( 'content' ); ?> <?php echo avia_blog_class_string(); ?>' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>> <?php if ( (in_category('saltwater') || in_category('us-based')) && !is_user_logged_in() ) { get_template_part( 'includes/trips' ); /* 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. * */ } else { get_template_part( 'includes/loop', 'index' ); ... ?> <!--end content--> </main>July 22, 2020 at 4:26 pm #1232300Hey hatchedconcepts,
The trips.php will work with the Classic editor only, the Advanced Layout Builder uses the template-builder.php.
Best regards,
VictoriaJuly 22, 2020 at 4:52 pm #1232327Thanks but If you READ the problem description I clearly said the post was using the Classic Editor. I know single.php only works with Classic. Anyhow I went a different direction because I am under deadline. You should note however that there is a bug here.
July 22, 2020 at 7:35 pm #1232358Hi hatchedconcepts,
Please have a look at this discussion:
https://wordpress.stackexchange.com/questions/310348/in-category-not-working-in-wordpress-4-9-7Best regards,
VictoriaJuly 22, 2020 at 9:12 pm #1232416You can close this – as I said I went a different direction.
July 22, 2020 at 10:58 pm #1232445Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Added code to single.php but not recognized’ is closed to new replies.
