[wp-trac] [WordPress Trac] #56337: Twenty Eleven: alignment in WooCommerce single product page's description tab content (was: Theme Twenty Eleven Single Product page in description tab content alignment issue)

WordPress Trac noreply at wordpress.org
Fri Aug 5 19:01:21 UTC 2022


#56337: Twenty Eleven: alignment in WooCommerce single product page's description
tab content
-------------------------------------------------+-------------------------
 Reporter:  umesh84                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Bundled Theme                        |     Version:  6.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots has-patch changes-   |     Focuses:  ui, css
  requested                                      |
-------------------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:  needs-design has-screenshots has-patch => has-screenshots has-
     patch changes-requested


Comment:

 Thanks for the report and the patch!

 I do not recommend aligning large-ish images to the left (or right) of
 text because that often involves floating, but changing the container
 width would help.

 Removing the `singular` body class seems to fix the description tab
 content width (and the sidebar when the theme uses it) on WooCommerce
 product pages. However, before a theme can call `is_product()`, it needs
 to verify that WooCommerce is activated to avoid causing errors on other
 sites.

 It could check if the function exists:
 `if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' )
 && ! is_page_template( 'sidebar-page.php' ) && ! ( function_exists(
 'is_product' ) && is_product() ) ) {`

 And possibly check for a WooCommerce version, in case someone creates a
 different `is_product` function:
 `if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' )
 && ! is_page_template( 'sidebar-page.php' ) && ! ( defined( 'WC_VERSION' )
 && function_exists( 'is_product' ) && is_product() ) ) {`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56337#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list