WooCommerce and Pinboard theme?

Viewing 15 posts - 16 through 30 (of 33 total)
  • #18214
    level200
    Participant

    ahh I see Daniel. I copied over the whole functions.php and it broke the site. how would I go about adding the changes to the child without the functions.php?

    #18221
    Daniel Tara
    Keymaster

    The child theme’s functions.php file is loaded before the parent theme’s functions.php file. You need to copy just the functions that you modified and without the if( function_exists( '...' ) ) :, endif; and add_action( '...' );statements.

    #18222
    Daniel Tara
    Keymaster

    Here’s an example of how a function looks like in functions.php:

    if ( ! function_exists( 'pinboard_filter_query' ) ) :
    /**
     * Filter the main loop
     *
     * Allows overriding of query parameters
     * for the main loop without performing
     * additional database queries
     *
     * @since Pinboard 1.0
     */
    function pinboard_filter_query( $query ) {
    	global $wp_the_query;
    	if( $wp_the_query === $query ) {
    		if( $query->is_home() && pinboard_get_option( 'slider' ) )
    			$query->set( 'ignore_sticky_posts', 1 );
    		if( $query->is_home() && pinboard_get_option( 'blog_exclude_portfolio' ) )
    			$query->set( 'cat', '-' . pinboard_get_option( 'portfolio_cat' ) );
    	}
    }
    endif;
    
    add_action( 'pre_get_posts', 'pinboard_filter_query' );

    This is how you should copy it in the child theme’s functions.php:

    function pinboard_filter_query( $query ) {
    	global $wp_the_query;
    	if( $wp_the_query === $query ) {
    		if( $query->is_home() && pinboard_get_option( 'slider' ) )
    			$query->set( 'ignore_sticky_posts', 1 );
    		if( $query->is_home() && pinboard_get_option( 'blog_exclude_portfolio' ) )
    			$query->set( 'cat', '-' . pinboard_get_option( 'portfolio_cat' ) );
    	}
    }
    #18228
    level200
    Participant

    Thanks for making that clear Daniel, I’m using this with a child theme now.

    One other thing I noticed since updating Pinboard. The product image Lightbox has stopped working and lost the Add to cart button for one product, This has only happened since updating pinboard. Is this to do with the update somehow?

    Product: http://www.northernwild.co.uk/index.php/product/test-print/#reset

    Cheers
    John

    • This reply was modified 10 years, 5 months ago by level200.
    #18230
    level200
    Participant

    After researching the possible problem, it seems to be coming from the theme.

    Possible issues here: https://github.com/woothemes/woocommerce/issues/1074

    Any thoughts Daniel?

    #18233
    Daniel Tara
    Keymaster

    Apparently it is caused by the latest version of the FlexSlider script. I’ll have to look more into it and let you know when it’s fixed.

    #18236
    level200
    Participant

    Are you still working on this Daniel? I have noticed a few changes and was wondering if its ok to re add my child function and style changes as they seem to have vanished.

    Cheers
    John

    #18238
    Daniel Tara
    Keymaster

    Yes, there is more than one issue I’m working on. It will probably be released the following days, I’ll let you know.

    #18239
    level200
    Participant

    Ok Daniel I’ll leave it in your capable hands. Good luck

    #18255
    Daniel Tara
    Keymaster

    Issue fixed in latest version, you can download it here.

    #18259
    level200
    Participant

    Great news Daniel. Fantastic service as always

    #18274
    level200
    Participant

    Hi Daniel

    Updated theme is working great thanks. I’m just reapplying functions and styles to the child theme.

    I’m having a problem with the child themes functions.php. I want to add the following code but the child function doesn’t seem to like it. The suggested code change that you mentioned for child function pages doesn’t seem to work with this sort of filter. Any suggestions?

    add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );

    function woo_remove_product_tabs( $tabs ) {

    unset( $tabs[‘description’] ); // Remove the description tab
    unset( $tabs[‘reviews’] ); // Remove the reviews tab
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab

    return $tabs;

    }

    #18275
    level200
    Participant

    Think its sorted now Daniel. I needed to wrap it around <?php ?> tags

    #19618
    ouzoliny
    Participant

    Hi Daniel, #level200,

    I am struggling to make the wrapping work. I followed the manual posted here however I cannot seem to make it work.

    I am using a child theme of pinboard, created a new function.php in the child theme directory and put the following code in:

    <?php
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
    
    add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
    add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
    
    function my_theme_wrapper_start() {
      echo '<section id="container">';
    }
    function my_theme_wrapper_end() {
      echo '</section>';
    }
    ?>

    This did not help. I tried to use “content” id instead of “container”, which made the side bar appear correctly, however, the products are now aligned on the far right of the page (as if within the right sidebar, which I am not using), while leaving the center content blank:
    Screenshot of the wrapping error

    I have also tried to use the “full length” template for product page, but it left the page with sidebar.

    Could you please clarify what exactly should I put into the child function.php?

    Thank you in advance, your help would be much appreciated πŸ˜‰

    #19654
    Daniel Tara
    Keymaster

    The WooCommerce container should be replaced with the theme’s container, but rather the theme’s container should wrap the WooCommerce container. I think that’s default behavior so the code above is not necessary. What guide are you following? The first result in the link you provided is for a different theme with the same name.

Viewing 15 posts - 16 through 30 (of 33 total)

You must be logged in to reply to this topic.