-
Author
Tagged: hard coded sidebar
-
July 31, 2015 at 12:39 #70940kntParticipant
Hello guys!
I want a custom sidebar for my activity page. How and where should i insert my code?
Cheers!
July 31, 2015 at 16:04 #70959sharmstrModeratorYou can try /kleo/sidebar.php. Just put a conditional check before generated_dynamic_sidebar
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 31, 2015 at 16:31 #70961kntParticipantHi @sharmstr, thanks for helping me again.
What would be the condition if i want to show my code on the sidebar of the Site Activitiy page with left and right sidebars. For instance i want to show it on the right sidebar. Any thoughts?
July 31, 2015 at 16:40 #70964sharmstrModeratorWhen using 2 sidebars, kleo uses the kleo_extra_sidebar function to display the right sidebar. Copy that function from /kleo/functions.php into your child theme. Do the conditional check there instead of in sidebar.php
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 31, 2015 at 16:46 #70966kntParticipantThe kleo_extra_sidebar function is in line 885. I’ve the template that the Site Activity page is using and it is calling for “3lr” which could be found at line 911 in the functions.php. How do you suggest i should do the conditional check?
By the way i’m not using a child theme because of performance concerns.
July 31, 2015 at 16:52 #70968sharmstrModeratorNot using a child theme is a bad idea if you’re going to be customizing.
I think you are miss understanding. When I say conditional check, I mean, checking to see if you are on the activity page. There’s no need to conditional check the location of the sidebar. Again, the extra sidebar function is all you need to change. That’s the function that renders the right sidebar in a left and right sidebar layout. Just make sure you set left and right sidebar layout in theme options > buddypress > activity page layout.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 31, 2015 at 17:04 #70972kntParticipantNot using a child theme is a bad idea if you’re going to be customizing.
– it’s okay @sharmstr, i don’t like child themes because it request another file, i don’t like that, though it’s barely noticeable in performance. I just like to modify the parent theme directly.
How do i check if i’m on the Activity page?
Again, the extra sidebar function is all you need to change.
– How do i change it? It’s in a switch statement. Please enlighten me.
July 31, 2015 at 17:09 #70974sharmstrModeratorBuddypress has bp_current_component to check where you are at within the buddypress context.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 31, 2015 at 17:12 #70975sharmstrModeratorpseudo code
COPY CODEfunction kleo_extra_sidebar() { $classes = apply_filters('kleo_extra_sidebar_classes', ''); echo '<div class="sidebar sidebar-extra '.$classes.'">' . '<div class="inner-content">'; if( bp_current_component() == 'activity' ) { echo "This is the activity page. You custom code here."; } else { generated_dynamic_sidebar($extra); } echo '</div>' .'</div> <!--end sidebar columns-->'; }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.