Tagged: x
-
AuthorPosts
-
May 4, 2016 at 4:14 am #912122
Karolina NParticipantHi! I am trying to set two specific sidebars to show up on single posts.
One for the blog wich will show the main sidebar and one for a new post-type that I have put in
I’m doing this in a child-theme and I’m working on single.php for the stack that I’m using.
But this does nothing on my page?
<?php if ( $fullwidth != ‘on’ ) : ?>
<?php get_sidebar(‘ups-sidebar-tidigare-tavlingar’); ?>
<?php endif; ?>I will work around the if statement later. Right now I’m just trying to get the right sidebar to get read.
Can you help me? 🙂
May 4, 2016 at 4:42 am #912154
Karolina NParticipantSo I figured out that I need to use dynamic sidebars but to the if else statement I can not get futher..
<?php
if ( $fullwidth != ‘on’ ) :
dynamic_sidebar(‘ups-sidebar-tidigare-tavlingar’);
elseif (is_blog ()) :
get_sidebar();
else :
get_sidebar();
endif;
?>I’m trying to set an && after $fullwidth != ‘on’ but I get errors doing that so what could I type in instead?
May 4, 2016 at 6:56 am #912313
Karolina NParticipantSorry I solved it. 🙂
Did this:
In single.php
<?php
if (is_blog ()) :
get_sidebar();
else : ?>
<aside class=”x-sidebar right” role=”complementary”> <?php dynamic_sidebar(‘ups-sidebar-tidigare-tavlingar’); ?> </aside> <?php
endif;
?>in functions.php
function is_blog () {
return ( is_archive() || is_author() || is_category() || is_home() || is_single() || is_tag()) && ‘post’ == get_post_type();
}May 4, 2016 at 7:13 am #912337
ThaiModeratorGlad you’ve sorted it out.
If you need anything else, please let us know 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-912122 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
