Tagged: x
-
AuthorPosts
-
January 7, 2017 at 8:20 am #1320124
I’m needing a custom taxonomy page to use for my woocommerce category pages and I can’t get this to work using the template structure of x. I’ve followed the instructions listed at https://community.theme.co/forums/topic/custom-category-archives-2/ and I see no changes happening after making the changes…so I think it might be how I’m naming the files?
I am placing the new files in: /themes/x-child/framework/views/ethos/
The files are named:
taxonomy-product_cat.php
wp-index-product_cat.php
_index-product_cat.phpJanuary 7, 2017 at 8:21 am #1320125This reply has been marked as private.January 7, 2017 at 10:54 am #1320251I also tried adding a modified woocommerce template file of taxonomy-product_cat.php in /themes/x-child/woocommerce
None of my changes in this file are showing up either.
January 7, 2017 at 6:57 pm #1320668Hello There,
Thanks for writing in! Would you mind providing us the ftp login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your credentials, we will be happy to assist you with everything.
To do this, you can make a post with the following info:
– FTP Hostname
– FTP Username
– FTP PasswordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
January 7, 2017 at 7:25 pm #1320677This reply has been marked as private.January 7, 2017 at 7:26 pm #1320678This reply has been marked as private.January 8, 2017 at 2:12 am #1320859Hi there,
Please check this https://docs.woocommerce.com/document/template-structure/
Gotcha: If your theme has a woocommerce.php file, you will be unable to override the woocommerce/archive-product.php custom template in your theme, as woocommerce.php has priority over other template files. This is intended to prevent display issues.
X theme uses woocommerce.php as integration and it’s more prioritized than any taxonomy or archive template. You can try removing the woocommerce.php in theme’s root directory. But it may have side effects on X theme’s woocommerce styling.
Thanks!
January 8, 2017 at 1:12 pm #1321295Thanks for that info. Yes, removing woocommerce.php allows my template changes to show up but removing woocommerce.php breaks the theme’s layout.
It seems like the best solution would be to modify the woocommerce.php file. I see code in that file for <?php if ( x_is_product() ) : ?> …so what would I need to add to that to have a separate sections of code for is_product_category( ‘wrist-malas’ ), is_product_category( ‘full-malas’ ), is_product_category( ‘additional’ )?
January 8, 2017 at 2:36 pm #1321377Would something like this work in woocommerce.php:
<?php // ============================================================================= // VIEWS/ETHOS/WOOCOMMERCE.PHP // ----------------------------------------------------------------------------- // WooCommerce page output for Ethos. // ============================================================================= ?> <?php get_header(); ?> <div class="x-container max width main"> <div class="offset cf"> <div class="<?php x_main_content_class(); ?>" role="main"> <?php if ( x_is_product() ) : ?> <?php x_ethos_entry_top_navigation(); ?> <?php woocommerce_content(); ?> } elseif (x_is_product_tag() ) : ?> <?php woocommerce_content(); ?> } elseif ( x_is_product_category( 'wrist-m' ) ) { echo do_shortcode( '[reactive key="13490"]' ); } elseif ( x_is_product_category( 'full-m' ) ) { echo do_shortcode( '[reactive key="13496"]' ); <?php else; ?> <?php woocommerce_content(); ?> </div> <?php get_sidebar(); ?> </div> </div> <?php get_footer(); ?>
January 8, 2017 at 7:37 pm #1321695Hi there,
Yes conditional would work, but that code will not. Try this,
<?php // ============================================================================= // VIEWS/ETHOS/WOOCOMMERCE.PHP // ----------------------------------------------------------------------------- // WooCommerce page output for Ethos. // ============================================================================= ?> <?php get_header(); ?> <div class="x-container max width main"> <div class="offset cf"> <div class="<?php x_main_content_class(); ?>" role="main"> <?php if ( x_is_product() ) : ?> <?php x_ethos_entry_top_navigation(); ?> <?php if ( is_product_category( 'wrist-m' ) ) : echo do_shortcode( '[reactive key="13490"]' ); ?> <?php elseif ( is_product_category( 'full-m' ) ) : echo do_shortcode( '[reactive key="13496"]' ); ?> <?php else : woocommerce_content(); endif; ?> </div> <?php get_sidebar(); ?> </div> </div> <?php get_footer(); ?>
Hope this helps.
January 9, 2017 at 7:36 am #1322323Thanks but when I added your code to VIEWS/ETHOS/WOOCOMMERCE.PHP I get a blank white screen. Can you figure out what in the code is causing the error?
January 9, 2017 at 7:42 pm #1323242Hi There,
A white screen usually means there is a fatal PHP error. Can you please enable WP_DEBUG mode? You can do this by opening
wp-config.php
and adding
define( 'WP_DEBUG' , true );
just above/* That's all, stop editing! Happy blogging. */
For example:define('WP_DEBUG', true); /* That's all, stop editing! Happy blogging. */
When you revisit the page with the white screen, you should have some error output describing the issue in more detail.
January 9, 2017 at 9:04 pm #1323322Parse error: syntax error, unexpected end of file in /wp-content/themes/x-child/framework/views/ethos/woocommerce.php on line 32
January 10, 2017 at 4:04 am #1323632Please add endif below x_ethos_entry_top_navigation
<?php x_ethos_entry_top_navigation(); ?> <?php endif; ?>
If that doesn’t help, or not what you expected, please check for syntax errors and if the functions or conditionals are correct.
Thanks.
January 10, 2017 at 7:30 am #1323846Thanks, that worked!
But now that I have debug on I see the following message on my woocommerce product page:
Notice: id was called incorrectly. Product properties should not be accessed directly. Please see Debugging in WordPress for more information. (This message was added in version 2.7.) in /wp-includes/functions.php on line 4091
How do I fix this?
-
AuthorPosts