Tagged: advanced-layout-editor, Custom Post Type, sidebar
-
AuthorPosts
-
October 21, 2016 at 9:10 am #702229
I want the ability to turn sidebars off on custom post types, specifically job listings on my main site, and download pages on my developer site. I’d ideally like to get the full sidebar controls that regular pages and posts.
Found and read a handful of posts on the subject from 2013, 2015, etc., like this one, but none seemed to work anymore, and in any case I run a child theme so think I need to do something a little different, like add something to functions.php instead of editing an actual config file.
Related, I’d like to add Advanced Layout Editor to custom post types, too.
Appreciate your help, thanks in advance.
- This topic was modified 8 years ago by JeeBar.
October 23, 2016 at 11:41 am #702972Hey JeeBar,
Can you try to add this code in functions.php:
add_filter('avf_builder_boxes', 'add_builder_to_posttype'); function add_builder_to_posttype($metabox) { foreach($metabox as &$meta) { if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout') { $meta['page'][] = 'my_custom_post_type_1'; $meta['page'][] = 'my_custom_post_type_2'; $meta['page'][] = 'my_custom_post_type_3'; } } return $metabox; }
Just replace my_custom_post_type_x and replace it with your custom post type. Let us know if it helps.
Best regards,
NikkoOctober 24, 2016 at 7:23 am #703137When you say “replace my_custom_post_type_x and replace it with your custom post type…”
How do I know what to put there? Is that the same as the slug for the custom post type?My jobs are URL like https://solace2.staging.wpengine.com/job/senior-full-stack-software-developer
I added the code you sent tweaked as follows, but it doesn’t do anything.
add_theme_support('avia_template_builder_custom_css'); add_filter('avf_builder_boxes', 'add_builder_to_posttype'); function add_builder_to_posttype($metabox) { foreach($metabox as &$meta) { if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout') { $meta['page'][] = 'job'; } } return $metabox; }
October 24, 2016 at 2:19 pm #703275Hi Jeebar,
Yes. If it doesn’t work then please post us your login credentials (in the “private data” field), so we can take a look at your backend.
Login credentials include:
- The URL to the login screen.
- A valid username (with full administration capabilities).
- As well as a password for that username.
Best regards,
NikkoOctober 24, 2016 at 7:04 pm #703400Thanks much. Here ya go. Credentials for staging environment in private content.
October 25, 2016 at 4:31 am #703533Hi Jeebar,
I have added the code above which I thought was removed and the stage site is now down because of an error. Can you remove the code I’ve added at the bottom of functions.php which is similar above. Also it’s not working because the post type is job_listing and not job. Let me know if it works and I apologize for my mistake.
Best regards,
NikkoOctober 25, 2016 at 5:31 am #703542No worries. That’s why we work on staging site. : )
I re-uploaded a clean functions.php and then put the code above in, with post type “job_listing” instead of job and it worked!
How did you identify the name of the custom post type? I’m going to need to do the same thing on my other site where a differnt plugin generates custom post type for downloads. I’ll provide access to that site too in case it’s easier for you to look up than tell me how to do.A related P.S. — why is the presentation of page content SO different when there’s no sidebar?
Here’s a job I was able to remove the sidebar from:
https://solace2.staging.wpengine.com/job/intermediate-full-stack-software-developerHere’s a job with sidebar:
https://solace2.staging.wpengine.com/job/human-resources-administratorI would expect/hope that the sidebar would just disappear and the content would run full width. But no…it centers the content, in a skinny page, with bigger font size. So annoying. I’ll address it by adding a new “Jobs Sidebar” with relevant content, but it’d be nice to be able to just kill sidebar and get the expect behavior.
October 25, 2016 at 5:51 am #703546Hi!
If it’s just the frontend, initial guess would be in the url. example: https://solace2.staging.wpengine.com/job/intermediate-full-stack-software-developer it’s looks like https://website.com/post_type/title, but if the post_type slug is rewritten then you can’t guess in the frontend. If you check on the backend and click on Job Listings you will have this url: https://solace2.staging.wpengine.com/wp-admin/edit.php?post_type=job_listing just by looking at the end of the url you will know the post type.
As for the layout it is how it was coded, if you want to preserve the style of the content and have the sidebar removed, I suggest doing so by removing the sidebar via css through Quick CSS. Hope this helps :)
Regards,
NikkoOctober 25, 2016 at 8:56 am #703654Thanks for your help. I was able to figure out the custom post type designator and it works over there too.
October 25, 2016 at 9:04 am #703660Hi,
Glad we could help! We really appreciate it if you rate our theme on themeforest https://themeforest.net/downloads
To know more about enfold features please check – http://kriesi.at/documentation/enfold/
Thank you for using Enfold :)Best regards,
Vinay -
AuthorPosts
- The topic ‘Add Sidebar Controls to Custom Post Type’ is closed to new replies.