{"id":10017720,"date":"2018-02-26T22:44:11","date_gmt":"2018-02-26T22:44:11","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/related-php-styling-css-javascript\/"},"modified":"2018-02-26T22:44:11","modified_gmt":"2018-02-26T22:44:11","slug":"related-php-styling-css-javascript","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/related-php-styling-css-javascript\/","title":{"rendered":"related.php Styling CSS\/Javascript"},"content":{"rendered":"<p>I am trying to override the Classes and ID&#8217;s and also some javascript in the &#8220;Related Products&#8221; section of single product pages. I want to replace the current styling with this nice looking one (http:\/\/nicesnippets.com\/live\/best-product-display-slider-using-bootstrap-demo.html).<\/p>\n<p>But I am unable to locate the html to change the classes.<\/p>\n<p>I would really appreciate any help or guidance.<\/p>\n<p>This is the code I am using:<\/p>\n<pre><code>&lt;?php\n\/**\n * Related Products\n *\n * This template can be overridden by copying it to yourtheme\/woocommerce\/single-product\/related.php.\n *\n * HOWEVER, on occasion WooCommerce will need to update template files and you\n * (the theme developer) will need to copy the new files to your theme to\n * maintain compatibility. We try to do this as little as possible, but it does\n * happen. When this occurs the version of the template file will be bumped and\n * the readme will list any important changes.\n *\n * @see \t    https:\/\/docs.woocommerce.com\/document\/template-structure\/\n * @author \t\tWooThemes\n * @package \tWooCommerce\/Templates\n * @version     3.0.0\n *\/\n\nif ( ! defined( &#039;ABSPATH&#039; ) ) {\n\texit;\n}\n\nglobal $product, $woocommerce_loop;\n\nif ( empty( $product ) || ! $product-&gt;exists() ) {\n\treturn;\n}\n\nif ( ! $related = $product-&gt;get_related( $posts_per_page ) ) {\n\treturn;\n}\n\n$args = apply_filters( &#039;woocommerce_related_products_args&#039;, array(\n\t&#039;post_type&#039;            =&gt; &#039;product&#039;,\n\t&#039;ignore_sticky_posts&#039;  =&gt; 1,\n\t&#039;no_found_rows&#039;        =&gt; 1,\n\t&#039;posts_per_page&#039;       =&gt; $posts_per_page,\n\t&#039;orderby&#039;              =&gt; $orderby,\n\t&#039;post__in&#039;             =&gt; $related,\n\t&#039;post__not_in&#039;         =&gt; array( $product-&gt;id )\n) );\n\n$products                    = new WP_Query( $args );\n$woocommerce_loop[&#039;name&#039;]    = &#039;related&#039;;\n$woocommerce_loop[&#039;columns&#039;] = apply_filters( &#039;woocommerce_related_products_columns&#039;, $columns );\n\nif ( $products-&gt;have_posts() ) : ?&gt;\n\n&lt;div class=&quot;collection-products&quot;&gt;\n            &lt;?php woocommerce_product_loop_start(); ?&gt;\n\n            &lt;?php while ( $products-&gt;have_posts() ) : $products-&gt;the_post(); ?&gt;\n\n                    &lt;?php wc_get_template_part( &#039;content&#039;, &#039;product&#039; ); ?&gt;\n\n            &lt;?php endwhile; \/\/ end of the loop. ?&gt;\n\n            &lt;?php woocommerce_product_loop_end(); ?&gt;\n\n\t&lt;\/div&gt;\n\n&lt;?php endif;\n\nwp_reset_postdata();\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-10017720","topic","type-topic","status-publish","hentry","topic-tag-css","topic-tag-javascript"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10017720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10017720\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10017720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}