Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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.
    #702972

    Hey 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,
    Nikko

    #703137

    When 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;
    }
    
    #703275

    Hi 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,
    Nikko

    #703400

    Thanks much. Here ya go. Credentials for staging environment in private content.

    #703533

    Hi 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,
    Nikko

    #703542

    No 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-developer

    Here’s a job with sidebar:
    https://solace2.staging.wpengine.com/job/human-resources-administrator

    I 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.

    #703546

    Hi!

    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,
    Nikko

    #703654

    Thanks for your help. I was able to figure out the custom post type designator and it works over there too.

    #703660

    Hi,

    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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add Sidebar Controls to Custom Post Type’ is closed to new replies.