-
AuthorPosts
-
July 22, 2016 at 1:05 pm #663843
Hi there,
Please can you help me with some code to remove the sidebar on portfolio item pages by default?
I’m using a child theme, so it would need to be in the child’s functions.php file.
Many thanks
DuncanJuly 25, 2016 at 10:10 pm #664858Hey Dunc,
Copy
single-portfolio.php
to your child theme and remove:get_sidebar();
Best regards,
JosueJuly 25, 2016 at 11:02 pm #664904Thanks Josue; I’ve tried that but the sidebar still appears (please see the link below).
Best regards
DuncanJuly 25, 2016 at 11:03 pm #664908Hi,
Can you please create me a WordPress administrator account? post it here as a private reply.
Regards,
JosueJuly 25, 2016 at 11:24 pm #664931Details below. It would be great if a future version of the Enfold theme could have separate dafault options for single posts and portfolio items in the sidebar settings!
- This reply was modified 8 years, 4 months ago by Dunc R.
July 26, 2016 at 12:07 am #664962Hi,
Ok let’s try a different way, try selecting no-sidebar for
Sidebar on Single Post Entries
, portfolio items inherit the settings of single post.Best regards,
JosueJuly 26, 2016 at 10:48 am #665224Hi Josue,
Thanks. Yes, I understand that, but I need single post sidebars to be on by default and portfolio item sidebars to be off by default.
Is there a filter/action that can be used in the functions file to recognise when a post is a portfolio item and turn the sidebar off?
Best regards
Duncan- This reply was modified 8 years, 4 months ago by Dunc R.
July 28, 2016 at 5:48 am #666048Hi,
Please use this in the functions.php file:
add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2); function avia_change_post_layout($layout, $post_id) { if( is_singular('portfolio') ) { $layout['current'] = $layout['fullsize']; $layout['current']['main'] = 'fullsize'; } return $layout; }
Best regards,
IsmaelJuly 28, 2016 at 10:11 am #666098Perfect, thanks Ismael; that function has worked!
Please can you log a new feature request…
• A separate ‘default’ sidebar setting for Portfolio items in the main theme options.Thanks again
DuncanJuly 28, 2016 at 1:43 pm #666226Hi!
Please feel free to send us any requests at
Thanks a lot
Regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.