-
AuthorPosts
-
April 13, 2022 at 12:26 pm #1348222
Hi,
My Blog Sidebar Widget shows on desktop but doesn’t show on a mobile device. Ideally I’d like it to show at the bottom of the blog page on mobile.
Information in the private area.
Thanks
April 13, 2022 at 1:13 pm #1348238Hey MikeTandySwag,
Thank you for the inquiry.
You can enable the sidebar on mobile view by toggling the Enfold > Sidebar Settings > Sidebar on Smartphones option, make sure to purge the cache afterwards.
Best regards,
IsmaelApril 14, 2022 at 10:07 pm #1348463Thank you! Is it possible to have the search feature above the blog posts on mobile?
Thanks
April 15, 2022 at 4:44 am #1348473Hi,
Yes, that should be possible. Try to add this code in the functions.php file.
add_action("ava_after_main_title", function() { global $avia_config; if( is_page(123) ) { get_search_form(); } }, 10);
Make sure to replace the value 123 in the is_page function with the actual ID of the blog page.
Best regards,
IsmaelApril 19, 2022 at 1:32 pm #1348794Great thanks!
How can I find the ID of the blog page when the blog is auto generated?
Thanks!
April 19, 2022 at 4:42 pm #1348823Hi,
You should be able to use the slug as well: https://developer.wordpress.org/reference/functions/is_page/. You should be able to get the page ID in the URL, when you edit the page as well.
Best regards,
RikardApril 19, 2022 at 6:11 pm #1348846Okay that’s what I thought. I used that page id and the code didnt work.
Any other thoughts?
April 21, 2022 at 10:14 pm #1349069Just wanted to follow up to see if there is a way to get the search bar above the blog as the PHP code didn’t work
April 23, 2022 at 1:12 pm #1349217Hi,
Thank you for your patience, I removed the above function and added this script to move the search above the blog content on mobile:function custom_move_search_script() { ?> <script> (function($) { var width = $(window).width(); if ( width <= 767) { $('#top.blog #search-3').css({ 'padding-bottom': '0'}).detach().insertBefore('.template-blog>main.content'); } else {} })(jQuery); </script> <?php } add_action('wp_footer', 'custom_move_search_script');
Please clear your browser cache and check.
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.