Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #873490
    Schlouff
    Participant

    Hi !

    So I’m trying to add a widget for people sort by categories and eventually by date in my blog page. The only thing is, I can’t get it to display any sidebar (and that wouldn’t probably look good) and I could use the footer, but then it’s displayed on all the pages…
    So I’ve found a solution on an other thread that is : to add

      <?php 
    		if ( is_active_sidebar( 'ups-sidebar-blog-sidebar' ) ) :
            dynamic_sidebar( 'ups-sidebar-blog-sidebar' );
       		endif;
       	?>

    in wp_single.php .. I’ve tired it it works great : but now I’d like to have that not in a single article, but on the blog page :
    http://www.xm-studio.com/en/news-3/
    Which file is that ?

    Also, would it be possible to have the categories displayed like in the portfolio page ? I mean I guess, all I need is to apply the CSS class, but where do I add that ? in the code above, or elsewhere in the custom sidebar file ?

    Hope you can help me cause this blog without any filter is really ridiculous ^^ !
    Thanks in advance !
    Xavier

    #873990
    Christopher
    Moderator

    Hi there,

    #1 Please follow this link to add sidebar https://community.theme.co/kb/unlimited-sidebars

    #2 Please edit portfolio page and make sure to uncheck the box ‘Disable Filtering’.

    Hope it helps.

    #875042
    Schlouff
    Participant

    Hi !

    So I should have precised that to follow this thread :
    https://community.theme.co/forums/topic/add-widget-to-blog-pages/
    I had to do #1. But again, I can’t get it to display any sidebar.

    Now I don’t understand what #2 has to do with my issue. But since the solution offered in the thread above worked great for a single article, I though that if you’d tell me in what file I should ad the code above, I could work for the blog page.

    About the portfolio, it’s only that I like the way it’s displayed and I was wondering if there was a way have the same look for a “categories” widget.

    Thanks in advance !

    #875645
    Rad
    Moderator

    Hi there,

    1. Back to your first question, add sidebar only on blog home page. Instead of wp-single.php, you’ll be working on wp-index.php

    And you should change your code to this,

    <?php 
    		if ( is_active_sidebar( 'ups-sidebar-blog-sidebar' ) && is_home() ) :
            dynamic_sidebar( 'ups-sidebar-blog-sidebar' );
       		else:
            get_sidebar();
       		endif;
       	?>

    It’s because wp-index.php is being used by other pages too, hence, it should be implemented for the page that’s used for blog home page.

    2. For the portfolio, are you referring to single portfolio page or portfolio index/home page? Would you mind providing a screenshot? I don’t see any sidebar from your provided site. It’s just a right positioned menu.

    Thanks!

    #881926
    Schlouff
    Participant

    Hi !

    Sorry for the delay, I got pretty busy at work !

    #1 –> Awesome ! it works perfectly ! I thought there might be a trick in the file structure… so thanks for the help there !

    #2 –> I figured it out using some css (the menu isn’t just a list of categories anymore, but a nice line with the same look as on the portfolio page )
    http://www.xm-studio.com/en/news-3/
    http://www.xm-studio.com/en/our-work-eng/

    So now people can filtrate the blog by categories and that great ! But once filtered, they get on the “archive page”, and the sidebar/widget isn’t displayed anymore. I assume this has something to do with the conditions in the if statement of the code you gave me. But what exactly ?

    Thanks a lot ! 😀

    #882624
    Jack
    Keymaster

    Hi there,

    Thanks for writing back, try updating your code to the following to check for the archives as well. 🙂

    <?php 
    	if ( is_active_sidebar( 'ups-sidebar-blog-sidebar' ) && is_home() || is_archive() ) :
    		dynamic_sidebar( 'ups-sidebar-blog-sidebar' );
       		else:
       			get_sidebar();
       		endif;
       	?>
       	

    Thanks!

    #885521
    Schlouff
    Participant

    It works great !

    Thanks a lot !

    #886405
    Christopher
    Moderator

    You’re welcome.

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