Home › Forums › WoodMart support forum › Blog page features not working correctly
Blog page features not working correctly
- This topic has 9 replies, 2 voices, and was last updated 6 years, 9 months ago by Artem Temos.
-
AuthorPosts
-
January 28, 2018 at 7:37 pm #35741
mjwilsonParticipantHello – I have now found two issues on the blog pages.
#1 – I have a “search” bar, in the sidebar widget for the blog page, which “should” enable a search for items on the blog itself. However, when I try to search for something on the blog, the search result is for items for sale, on my main site.
Is there any way to have this search bar only search for blog items, since you are on the blog page, when doing the search?
#2 – When you are on a post page itself, and at the bottom where it shows links for “Newer” or “Older” posts, they are switched around. Under the “newer” tab, it shows an older post, and under the “older” tab, it shows a newer post. I didn’t see anywhere to change this, within the theme settings, as you can only turn that setting off and on.
Help!
Thanks.
Mj
January 29, 2018 at 7:59 am #35812
Artem TemosKeymasterHi,
1. Add this code to the functions.php file in the child theme to be able to choose post type for the search widget http://prntscr.com/i714uy
$path = get_template_directory() . '/inc/third-party/wph-widget-class.php'; if ( file_exists( $path ) ) { require_once $path; } class WOODMART_Widget_Search extends WPH_Widget { function __construct() { if( ! woodmart_woocommerce_installed() ) return; $args = array( 'label' => esc_html__( 'WOODMART AJAX Search', 'woodmart' ), 'description' =>esc_html__( 'Search form by products with AJAX', 'woodmart' ), ); $args['fields'] = array( array( 'id' => 'title', 'type' => 'text', 'std' => esc_html__( 'Search products', 'woodmart' ), 'name' => esc_html__( 'Title', 'woodmart' ) ), array( 'id' => 'search_type', 'type' => 'dropdown', 'std' => 'and', 'name' => esc_html__( 'Search type', 'woodmart' ), 'fields' => array( esc_html__( 'Product', 'woodmart' ) => 'product', esc_html__( 'Portfolio', 'woodmart' ) => 'portfolio', esc_html__( 'Post', 'woodmart' ) => 'post' ) ), array( 'id' => 'number', 'type' => 'number', 'std' => 4, 'name' => esc_html__( 'Number of products to show', 'woodmart' ), ), array( 'id' => 'price', 'type' => 'checkbox', 'std' => 1, 'name' => esc_html__( 'Show price', 'woodmart' ), ), array( 'id' => 'thumbnail', 'type' => 'checkbox', 'std' => 1, 'name' => esc_html__( 'Show thumbnail', 'woodmart' ), ), ); $this->create_widget( $args ); } function widget( $args, $instance ) { extract($args); echo $before_widget; $number = empty( $instance['number'] ) ? 3 : absint( $instance['number'] ); $thumbnail = empty( $instance['thumbnail'] ) ? 0 : absint( $instance['thumbnail'] ); $price = empty( $instance['price'] ) ? 0 : absint( $instance['price'] ); $search_type = empty( $instance['search_type'] ) ? woodmart_get_opt('search_post_type') : $instance['search_type']; if ( $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance ) ) { echo $before_title . $title . $after_title; } $args = array( 'count' => $number, 'thumbnail' => $thumbnail, 'price' => $price, ); woodmart_header_block_search_extended( $search_type, false, true, $args ); echo $after_widget; } function form( $instance ) { parent::form( $instance ); } }
2. We will fix this issue in the next theme update.
Regards
January 31, 2018 at 12:35 am #36269
mjwilsonParticipantCan this code be added anywhere else? We don’t have a child theme loaded.
Thanks.
January 31, 2018 at 7:27 am #36303
Artem TemosKeymasterIn this case, you need to install and activate the child theme if you want to apply any kind of code customization and prevent losing them after theme updates.
February 4, 2018 at 8:26 pm #37402
mjwilsonParticipantThanks. I’ll wait for the updated version of the theme!
February 5, 2018 at 7:15 am #37430
Artem TemosKeymasterOK, you are welcome!
February 24, 2018 at 8:55 pm #42120
mjwilsonParticipantI thought this issue was getting fixed in the newest update? I don’t think it works yet? When you search on the blog you still get products.
February 24, 2018 at 9:23 pm #42125
Artem TemosKeymasterYou just need to keep the code we gave you regarding the search form. We wrote you that we fix the problems with navigation in the update. But search question was not a bug but it is how it works. We will consider adding some more option for that in our future updates but for now just keep the solution we gave you.
February 24, 2018 at 9:41 pm #42127
mjwilsonParticipantAh…you’re right! You DID fix the “previous/next” issue, with the latest theme update (thank you!)
We don’t have a child theme loaded yet…we may have to do that.
Thanks.
February 25, 2018 at 8:00 am #42148
Artem TemosKeymasterOK, contact us if you will have any extra questions.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register