Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #386118

    I have several different users on my site and each has their own customized sidebar for their site. However the users do not have much of a technical background and I want to make posting for them as easy as possible. Is it possible to set up a default sidebar for some of the users that is different for each one?

    Also, each user has their own category, so if the sidebar could be set by category this would also work perhaps even better.

    Perhaps there is a custom css I could insert for one user, for example, as I know this is not in the normal settings options.

    • This topic was modified 9 years, 11 months ago by bingisser.
    #386453

    Hi bingisser!

    I’m not really sure I understand. Your trying to change the sidebar of one of your pages based on if a certain user is logged in?

    Can you send us a link to the page so we can get a better idea?

    Best regards,
    Elliott

    #386477

    No, I’m trying to make it so that a certain author or category can have a default sidebar.

    #387366

    Hi!

    Open up /enfold/sidebar.php and on line 44 you should see this.

    if($custom_sidebar)
    

    Add this above it.

    if ( is_author() ) { $custom_sidebar = "author"; }
    if ( is_category() ) { $custom_sidebar = "category"; }
    

    And then create two new widget areas in Dashboard > Appearance > Widgets named “author” and “category”.

    Regards,
    Elliott

    #387675
    This reply has been marked as private.
    #388517

    Hey!

    It seems to be working fine. I added a meta widget to only the Vern widget area and it’s only displaying in your Vern category archives.

    Regards,
    Elliott

    #388525

    I think it is working because I have manually set all the post to have that sidebar. What I was looking for is when I create a new post that it sets correct sidebar by default. I have inserted the code, but when I create a new post in that category it uses simply the “Default Sidebars” which does not show the correct one. Does that make sense?

    #388977

    Hi!

    If you want to show a specific widget on archive pages, please use the following plugin.

    https://wordpress.org/plugins/widget-logic/

    Cheers!
    Ismael

    #388981

    This might work, but I’m still wondering why the code above does not work. The goal is to get one category to show one sidebar by default.

    #389602

    Hey!

    The archives are going to use the “Sidebar Blog” widget area by default. You can override that for each category using the code sample in my previous posts but the “Displayed Everywhere” widget area is still going to display. If you do not want that then you’ll want to remove the widgets you have set to the “Displayed Everywhere” widget area and add them separately to each. Or you can use the plugin Ismael posted.

    Regards,
    Elliott

    #389615
    This reply has been marked as private.
    #390323

    Hey!

    I’m not sure what you mean. The “vern” widget area you have created is displaying on your vern category archives correctly.

    Take some screenshots and highlight what your trying to do so we can get a better idea.

    Regards,
    Elliott

    • This reply was modified 9 years, 10 months ago by Elliott.
    #390345
    This reply has been marked as private.
    #390924

    Hi!

    So your talking about the single posts then instead of the category archives? In this case you need to use the in_category conditional check, http://codex.wordpress.org/Function_Reference/in_category, instead of is_category.

    Regards,
    Elliott

    #1103465

    Hi Enfold Support,
    On a related topic, is it possible to remove sidebars from posts of specific categories? We have different post types (by category) e.g. blog posts, press release posts, article posts, event posts, etc. Currently on our press release posts we don’t want a side bar. Instead of selecting the “no sidebar layout” in the avia builder widget, we’d rather simply have all press release posts not contain a sidebar. Is this possible through a functions.php or sidebar.php update in our child theme?

    Also, we’d like to keep the same left aligned layout of the post. We noticed that if we manually select on each post “No Sidebar Layout”, the post content becomes centered with an empty featured image placeholder at the top.

    Thanks in advance for your help!
    -E

    #1103676

    Hi Eric,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

    #1104011

    Victoria, if you’re able to provide a solution to make a specific sidebar appear based on the sidebar category (see above in Elliot’s response), how is it we can’t simply have the entire sidebar disappear by updating the sidebar.php file with a similar snippet of code?
    Seems there could be a “display: ‘none’ ” script to make this happen.

    #1104012

    Also, how can we update the no sidebar post template to align left similar to how the with sidebar template layout? Thank you!

    #1104720

    Hi,

    Thanks for the update.

    Have you tried editing the single.php file? Just wrap this line of code in a conditional function.

    //get the sidebar
    get_sidebar();

    // https://codex.wordpress.org/Function_Reference/has_category

    Best regards,
    Ismael

    #1105498

    Thanks Ismael! We’ll give it a shot and let you know how it goes.

    #1105499

    Regarding the layout for posts with no sidebar, how can we keep the content to be aligned left similar to how the the layout is when the sidebar is present? Thanks!

    #1106536

    Hi,

    Thank you for the update.

    You can use this css code to change the style of the full width posts.

    #top .fullsize .template-blog .post .entry-content-wrapper > * {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    #top .fullsize .template-blog .post .entry-content-wrapper {
        text-align: left;
        max-width: 800px;
        margin: 0;
    }

    Best regards,
    Ismael

Viewing 22 posts - 1 through 22 (of 22 total)
  • You must be logged in to reply to this topic.