Tagged: x
-
AuthorPosts
-
April 8, 2016 at 6:54 pm #873490
SchlouffParticipantHi !
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 !
XavierApril 9, 2016 at 5:49 am #873990
ChristopherModeratorHi 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.
April 10, 2016 at 5:58 am #875042
SchlouffParticipantHi !
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 !
April 10, 2016 at 6:02 pm #875645
RadModeratorHi 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!
April 14, 2016 at 5:23 am #881926
SchlouffParticipantHi !
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 ! 😀
April 14, 2016 at 11:44 am #882624
JackKeymasterHi 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!
April 16, 2016 at 4:40 am #885521
SchlouffParticipantIt works great !
Thanks a lot !
April 17, 2016 at 12:20 am #886405
ChristopherModeratorYou’re welcome.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-873490 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
