Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1350340
    blissmarketing
    Participant

    Hey

    I have had a look through some of the forum answers but wasn’t sure if the .single code would apply to how we have the posts set up

    On our site we have the regular blog posts (which we like the sidebar on )
    Then we have another category set up called ‘publicity’ Which has all our publicity which we imported from our old wordpress site… thing is these imports have imported as ‘articles’ al be it in a seperate category

    Thing is we don’t wish to have the sidebar on any of the publicity listings. Would this be possible? Or would I need to go through each individual publicity post and change?

    Log in info in next message
    Jen x

    #1350341
    blissmarketing
    Participant
    This reply has been marked as private.
    #1350342
    blissmarketing
    Participant

    image

    #1350344
    blissmarketing
    Participant

    I have just realised from being in essential grid they have registered as articles?

    Would this mean they are different to blog posts?

    #1350348
    Christopher
    Moderator

    Hi there,

    I don’t find the category publicity in your site, please provide us with category URL. Currently your site displays default sidebar. Please add widget to your custom sidebar such as ‘custom’ or ‘facebook’ sidebars and assign sidebar to pages/posts.

    Hope it helps.

    #1350362
    blissmarketing
    Participant

    Hey Chris

    It is on the screenshot above URL – http://oak.blisssanctuaryforwomen.com/wp-admin/edit.php?post_type=publicity

    So how would i not have a sidebar on these publicity posts

    or is there a way to remove the blog sidebar too and like you said i will just add custom to the blog sidebar (a recent posts sidebar etc)

    Jen

    #1350386
    Paul R
    Moderator

    Hi,

    To remove sidebar on publicity posts, you can add the code below in your child theme’s functions.php file.

    
    function publicity_layout($contents) {
      
      if ( get_post_type()  == "publicity") {
    
        $contents = 'full-width';
      }
      
      return $contents;
    }
    
    add_filter('x_option_x_layout_content', 'publicity_layout');
    

    Hope that helps.

    #1352087
    blissmarketing
    Participant

    Amazing – that worked perfectly – thankyou so much!!!!

    Is there also a way tha tthe featured image could not be shown on the main post of all the publicity posts too please?

    Would that be php or css

    Thanks so much again xxxxxx 🙂

    #1352123
    blissmarketing
    Participant

    i managed to sort the featured images out 🙂

    is there a way to remove the date from blog posts / articles?
    and also on the main blog posts the sidebar still shows even though i have set to full page

    Can i use the code below also for the main blog posts please? what would i change ‘ publicity too?

    function publicity_layout($contents) {

    if ( get_post_type() == “publicity”) {

    $contents = ‘full-width’;
    }

    return $contents;
    }

    add_filter(‘x_option_x_layout_content’, ‘publicity_layout’);

    #1352166
    Thai
    Moderator

    Hi There,

    Please try with this code:

    function publicity_layout($contents) {
      
      if ( get_post_type()  == "publicity" || is_home() ) {
    
        $contents = 'full-width';
      }
      
      return $contents;
    }
    
    add_filter('x_option_x_layout_content', 'publicity_layout');

    After that add the following CSS under Customizer > Custom > Global CSS:

    .single .p-meta {
    display: none;
    }

    Hope it helps 🙂

    #1353146
    blissmarketing
    Participant

    hey 🙂

    That is the same code? for the main blog posts would it still say publicity? im confused lol

    #1353150
    blissmarketing
    Participant

    iv used the

    .single-post .entry-featured {
    display:none;
    }

    But blog post featured images still showing? see attached image

    #1353354
    Paul R
    Moderator

    Hi,

    We added is_home in the conditional statement.

    if ( get_post_type() == "publicity" || is_home() )

    With regards to featured image, the code should work.

    Can you provide us the exact url of that post page.

    Thanks

  • <script> jQuery(function($){ $("#no-reply-1350340 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>