Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1408119
    lalumina
    Participant

    Hi! I am trying to set up a new pluggin and the instructions say: Put the Short Code [yt2wp_show_youtube_video width=”640″ height=”360″] inside your post or put the code <?php echo do_shortcode( ‘[yt2wp_show_youtube_video width=”640″ height=”360″]’ ); ?> to your template page where the post loop exist.

    I am working on this site http://www.carissakranz.com and I want to pluggin to be posting videos from the YouTube channel automatically. I am not sure where to find the template post for the Appearances Category in order to add that short code.

    Thank you in advance for your help!

    #1408418
    Jade
    Moderator

    Hi there,

    Please try to add the shortcode [yt2wp_show_youtube_video width="640" height="360"] in a Raw Content element in Cornerstone.

    Hope this helps.

    #1408521
    lalumina
    Participant

    But where on what page? It need to apply to all posts or posts in the appearances category.

    #1409103
    Lely
    Moderator

    Hi There,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the following code on your child theme functions.php file:

    add_filter( 'the_content', 'add_content_after_post' );
    function add_content_after_post($content){
      if ( is_singular('post') && in_category('appearances') ) {
        $content .= do_shortcode('[yt2wp_show_youtube_video width="640" height="360"]');
      }
    
      return $content;
    }

    From this line: in_category('appearances') make sure that appearances is the slug of that category.
    It will be displayed after the content.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1408119 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>