-
AuthorPosts
-
April 16, 2024 at 10:14 am #1440098
Hi,
I have some issues with my sidebar. It doesn’t respond to the settings in Sidebar Settings. At the moment I have no sidebar at all, but i would really like a left sidebar on all woocommerce category pages.As it won’t respond to the sidebar settings and has its own life, I have added the following code to my function.php file, but that is not a satisfying solution. I would really like the theme settings to work.
add_filter(‘avia_layout_filter’, ‘avia_change_post_layout’, 10, 2);
function avia_change_post_layout($layout, $post_id) {
if( is_archive() ) {
$layout[‘current’] = $layout[‘fullsize’];
$layout[‘current’][‘main’] = ‘fullsize’;
}return $layout;
}Can you please help me out?
April 17, 2024 at 7:55 am #1440156Hey ditteditte,
Thank you for the inquiry.
We adjusted the avia_layout_filter filter a bit. Please replace the current filter with the following code:
function avf_change_sidebar_layout($layout, $post_id) { if ( is_archive() && !is_product_category() ) { $layout['current'] = $layout['fullsize']; $layout['current']['main'] = 'fullsize'; } return $layout; } add_filter('avia_layout_filter', 'avf_change_sidebar_layout', 10, 2);
Best regards,
IsmaelApril 17, 2024 at 9:42 am #1440172Hi,
Thank you for your reply. I tried to replace the filter, but making changes in sidebar settings still doesn’t respond.Further more my second category description (placed at the bottom of the page) crawl op in the sidebar. It might be a number thing that has to be ajusted.
I added the second description with this code:// —————
// 4. Display field under products @ Product Category pagesadd_action( ‘woocommerce_after_shop_loop’, ‘bbloomer_display_wp_editor_content’, 20 );
function bbloomer_display_wp_editor_content() {
if ( is_product_taxonomy() ) {
$term = get_queried_object();
if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) {
echo ‘<p class=”term-description”>’ . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) . ‘</p>’;
}
}
}April 18, 2024 at 7:34 am #1440261Hi,
Thank you for the update.
We tried to access the site, but it requires two-factor authentication. Could you please temporarily disable this feature so that we can access the dashboard and check the modifications? Make sure that the Appearance > Theme File Editor panel is accessible.
Best regards,
IsmaelApril 18, 2024 at 1:55 pm #1440291two-factor authentication is now disabled and Theme File Editor enabled.
April 19, 2024 at 2:23 am #1440335Hi,
The functions.php file still had the older version of avia_layout_filter without the is_product_category conditional function. We’ve updated the code. Please review it again.
Best regards,
IsmaelApril 19, 2024 at 8:49 am #1440338Hi,
Unfortunately i still don’t se any changes. Product categories dosen’t react to changes made in sidebar settings. I can’t move the sidebar from right to left and I can’t hide the sidebar either.Try to make changes an see what happens on this page https://nederkjaersholm.dk/produkt-kategori/brugskunst/
Further more the second category description still crawls op in the sidebar as described above.
April 22, 2024 at 7:20 am #1440487Hi,
Thank you for the info.
In our own installation, the sidebar position on the product category pages changes correctly when we adjust the Sidebar On Archive Pages settings. Have you tried temporarily disabling the plugins? You should also test this without the modifications in the child theme’s functions.php file.
Best regards,
IsmaelApril 25, 2024 at 10:44 am #1440787Hmm I tried that whitout any effect.
But I figured that it migt not be the “Sidebar On Archive Page” that is not responding, as I first thought, but instead it is the widget area called “shop overview page”.
The widget area called “shop overview page” appears on all my product category pages as a right sidebar. Where do I control this sidebar? It migt not be part of the Enfold sidebar settings.
April 25, 2024 at 2:06 pm #1440826Never mind i figured it out
April 25, 2024 at 5:22 pm #1440854Hi,
Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardApril 26, 2024 at 8:34 am #1440916Well I would still have this custom field displaying a second category description that I can’t display at the right place. It should be at the bottom af every category pages underneath the pagination, but at the moment it is too far down under the sidebar.
Take a look at this page at the bottom: https://nederkjaersholm.dk/produkt-kategori/have-indretning/have-interioer/
// —————
// 4. Display field under products @ Product Category pagesadd_action( ‘woocommerce_after_main_content’, ‘bbloomer_display_wp_editor_content’, 11 );
function bbloomer_display_wp_editor_content() {
if ( is_product_taxonomy() ) {
$term = get_queried_object();
if ( $term && ! empty( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) {
echo ‘<p class=”term-description”>’ . wc_format_content( htmlspecialchars_decode( get_woocommerce_term_meta( $term->term_id, ‘seconddesc’, true ) ) ) . ‘</p>’;
}
}
}April 26, 2024 at 10:07 am #1440932Hi,
Try to replace the woocommerce_after_main_content hook with woocommerce_after_shop_loop. This should render the description right after the product grid
Best regards,
IsmaelApril 26, 2024 at 3:43 pm #1440976That moved the description up in top of the sidebar. I then changed 11 to 10 which moved it down, but it went between the products and the pagination. So now I just need the pagination back up underneath the products.
April 29, 2024 at 8:20 am #1441254Hi,
Thank you for the update.
Try to replace the hook with woocommerce_after_shop_loop, then set the priority to 15.
Best regards,
IsmaelApril 29, 2024 at 8:27 am #1441257Then It went up in the sidebar again.
April 30, 2024 at 7:44 am #1441391Hi,
Sorry about that. We adjusted the hook a bit, then added this script to move the second description below the pagination.
function ava_custom_script() { ?> <script> (function ($) { function moveTermDescription() { if ($('.term-description-second').length && $('.pagination').length) { $('.term-description-second').insertAfter('.pagination'); } } $(document).ready(function () { moveTermDescription(); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script');
Best regards,
IsmaelApril 30, 2024 at 9:23 am #1441402Great! Thank you!!!!!!! It looks nice!
May 1, 2024 at 6:43 am #1441546 -
AuthorPosts
- The topic ‘Sidebar not responding’ is closed to new replies.