WordPress.org

Support

Support » Plugins and Hacks » Video on category pages

Video on category pages

  • <?php
    
    if ( is_category( \'shop/' ) ) {
    ?>
    
    // <iframe width="560" height="315" src="//www.youtube.com/embed/rxX9PRhvIL0?list=PL959AE597E59B6863" frameborder="0" allowfullscreen></iframe>
    
    <?php
    }
    
    ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    and am pasting in into my archive-product.php file.

    I am getting this error:

    Parse error: syntax error, unexpected ‘(‘, expecting T_STRING or T_VARIABLE or ‘$’,

    What is wrong with my code?

    http://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thia code works!

    <?php
    
    function woo_add_video_on_category_page() {
    
        if ( is_product_category( 'posters' ) ) {
            echo '<iframe width="560" height="315" src="//www.youtube.com/embed/rxX9PRhvIL0?list=PL959AE597E59B6863" frameborder="0" allowfullscreen></iframe>';
        }
    
    }
    
    add_action( 'woocommerce_before_shop_loop', 'woo_add_video_on_category_page' );
    
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Video on category pages’ is closed to new replies.