Tagged: x
-
AuthorPosts
-
November 4, 2016 at 10:03 am #1243832
inlifestyleParticipantCan anything be done if the last category doesnt have a sidebar assigned to it, can it fall back to the 2nd or 3rd to last category added?
November 4, 2016 at 8:52 pm #1244626
RadModeratorHi there,
It pickups the categories assigned to the post hence, if there is no assigned category then it’s empty and no second, third, or fourth. Though I see a flaw from that code, let’s change it to this so it would use Main Sidebar as default when there is no assigned sidebar to the category.
add_filter( 'ups_sidebar', 'ups_display_category_sidebar', 99 ); function ups_display_category_sidebar ( $sidebar ) { if ( is_singular( 'post' ) ) { $terms = get_the_terms( get_the_ID(), 'category' ); if ( isset( $terms ) && count( $terms ) > 0 ) { $term = array_pop( $terms ); $setting = get_option( "taxonomy_".$term->term_id ); $sidebar = !empty( $setting['category-sidebar'] ) ? $setting['category-sidebar'] : $sidebar; } } return $sidebar; }Cheers!
November 15, 2016 at 9:33 am #1258056
inlifestyleParticipantCan it use the sidebar from the 2nd or 3rd if the first category didnt have a sidebar associated with it?
November 16, 2016 at 1:44 pm #1259795
RadModeratorHi there,
It can’t, but it will use the default Main Sidebar if there is no assigned sidebar. What you need to achieve is possible through another set of code, but that will make it much slower since it needs to run on every page’s load just to detect the availability for the category sidebar. And you may wish to consult it to a developer since it’s more complex.
Thanks for understanding.
December 8, 2016 at 10:32 am #1286236
inlifestyleParticipantWe are experiencing disappearing sidebars, what could be causing this? Is there a max, we do have a lot but wouldnt think it would start deleting custom sidebars.
December 8, 2016 at 4:07 pm #1286619
LelyModeratorHello There,
Would you mind giving us the specific link where the sidebar disappear? This is to ensure that we can provide you with a tailored answer to your situation.
December 12, 2016 at 3:53 pm #1290497
inlifestyleParticipantThis reply has been marked as private.December 13, 2016 at 7:10 pm #1292123
LelyModeratorHello There,
I did check your error log via FTP. There was no error log recently and the last one was dated January 5 2016. Then I did check again your custom Sidebars and it is there although it took a while for everything to load. See this:http://screencast-o-matic.com/watch/cDl2VjQ32q
December 14, 2016 at 5:19 pm #1293466
inlifestyleParticipantyes the custom sidebars are there, but 16 of them disappeared and we had to recreate them. What would be the explanation for this?
December 14, 2016 at 10:30 pm #1293781
RadModeratorHi there,
Have you updated your X theme from the very old version? Or did some search and replace within the database? That’s the only two reason I could think of since custom sidebars are saved within the database.
Thanks!
December 28, 2016 at 1:24 pm #1307509
inlifestyleParticipantWe didnt do anything in the database or upload at the time the sidebars disappeared.
December 28, 2016 at 7:57 pm #1307986
RadModeratorHi there,
Hmm, I’m not sure what happened and this is my first time hearing this kind of issue. And it shouldn’t disappear just like that, it’s either accidentally removed or corrupted data.
You may restore your backup if available.
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1163391 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
