Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
March 29, 2018 at 6:32 am #934685
hi. I have a CPT named lawyer. I have copied single.php and made single-lawyer.php in enfold-child. I dont want sidebar in this. I have made only 1 change in single-lawyer.php –
// get_template_part( 'includes/loop', 'index' ); the_content();deleting this code from single-lawyer.php does not help me –
<?php $avia_config['currently_viewing'] = "blog"; //get the sidebar get_sidebar(); ?>I cant do so from theme options “Choose the blog post sidebar position here. This setting will be applied to single blog posts”
Because it removes sidebar from blog entry also.
Please suggest a solution or code in funcations.php
March 29, 2018 at 10:43 pm #935029Hey simran1982,
Please make the code as following
<?php $avia_config['currently_viewing'] = "blog"; //get the sidebar //get_sidebar(); ?>And let us know if that worked out.
Best regards,
BasilisNovember 19, 2021 at 11:16 am #1329640Better solution without changing the template:
if(!function_exists('avia_layout_class')) { function avia_layout_class($key, $echo = true) { global $avia_config; if(!isset($avia_config['layout']['current']['main'])) { avia_set_layout_array(); } $return = apply_filters('avia_layout_class',$avia_config['layout']['current'][$key]); if( $echo == true ) { echo $return; } else { return $return; } } } add_filter('avia_layout_class', 'cpt_change_sidebar'); function cpt_change_sidebar($class) { if (get_post_type() == 'referenzen') { $class = str_replace("av-content-small","",$class); } // this removes the sidebar from CPT defined return $class; }Unfortunatly the function has no filter, so I add one and replace the msall function, then add the hook to change the layout.
November 19, 2021 at 3:05 pm #1329697 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
