Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter Bethzy Elonia

    (@east2611)

    For HTML and javascript minification I am just using w3 total cache and for css minification I am using Cloudflare. The cloudflare rocket loader defers the javascripts but I don’t want that specific javascript to be defered by cloudflare.

    Thread Starter Bethzy Elonia

    (@east2611)

    Hi, i have saved the script in my child-theme as youtube-light-player.js

    Here is youtube-light-player.js

            /* Light YouTube Embeds by @labnol */
            /* Web: https://labnol.org/?p=27941 */
         
            document.addEventListener("DOMContentLoaded",
                function() {
                    var div, n,
                        v = document.getElementsByClassName("youtube-player");
                    for (n = 0; n < v.length; n++) {
                        div = document.createElement("div");
                        div.setAttribute("data-id", v[n].dataset.id);
                        div.innerHTML = labnolThumb(v[n].dataset.id);
                        div.onclick = labnolIframe;
                        v[n].appendChild(div);
                    }
                });
         
            function labnolThumb(id) {
                var thumb = '<img src="https://i.ytimg.com/vi/ID/hqdefault.jpg">',
                    play = '<div class="play"></div>';
                return thumb.replace("ID", id) + play;
            }
         
            function labnolIframe() {
                var iframe = document.createElement("iframe");
                var embed = "https://www.youtube.com/embed/ID?autoplay=1";
                iframe.setAttribute("src", embed.replace("ID", this.dataset.id));
                iframe.setAttribute("frameborder", "0");
                iframe.setAttribute("allowfullscreen", "1");
                this.parentNode.replaceChild(iframe, this);
            }
     

    and included it in my single-custom-post-type.php like this below
    <script src="/wp-content/themes/childhueman/my-custom-js/youtube-light-player.js" async></script>

    and in my child theme functions i created this shortcode below

    add_shortcode('collapso_short_contributor_video','collapso_short_contributor_video_fctn');
    function collapso_short_contributor_video_fctn() {
    	$output = '';
    
    	$grows = CFS()->get('youtube_video_id');
    	$dmrows = CFS()->get('dailymotion_embed_code');
    				if ($grows) {
    					ob_start ();
    
    					$utube_video_id = CFS()->get('youtube_video_id');
    					$utube_username = CFS()->get('youtube_username');
    
    					echo '<div class="targ-video">';
    						echo '<div class="youtube-player" data-id="'.$utube_video_id.'"></div>';
    					echo '</div>';
    
    					$grow_content = ob_get_contents ();
    					ob_end_clean ();
    					
    					$output .=  '<div class="collapsomydiv" id="collapsomyid">';
    					$output .=  do_shortcode( '[expand title="▼ Show Video" expanded="true" notitle="true" id="collapseoutube" trigclass="mytrigclass snap-shut" targclass="targoutube" swaptitle="▲ Hide Video" tag="h2"]' .$grow_content. '[/expand]' );
    					$output .=  '</div>';
    					$output .=  '<div class="clear"></div>';
    				}
    	return $output;
    }
    

    and then displaying the video by including this shortcode in my posts content
    [collapso_short_contributor_video]

    Thread Starter Bethzy Elonia

    (@east2611)

    it worked thanks again ??

    Thread Starter Bethzy Elonia

    (@east2611)

    yeah it did the work, thanks again for the continuous support, marking it as resolved.

    Thread Starter Bethzy Elonia

    (@east2611)

    PERFECT! just one last request i want links in posts title only not the terms info to be linked. terms info should be in black. see here https://guitarutha.com/kabira-guitar-chords/ both post title and info is linked in blue. and please tell me how to mark this topic resolved.

    Thread Starter Bethzy Elonia

    (@east2611)

    i m already using child theme and site-specific plugin. You are fabulous it worked like a charm, but there’s a lil problem with total terms. total terms are showing the numbers of terms of the post on which visitor is currently viewing, i want to show the total terms of the post, next to which we are dispaying this common terms.
    like:
    post title-0 on the top
    .
    .
    .
    .
    some post content
    .
    .
    .
    .
    more cars on similar brands(shown by ur plugin)
    1> post title-1 – 3/(show total terms of this post) – A,C,D
    2> POST TITLE-2 – 4/(show total terms of this post) – A,B,C,D.

    Thread Starter Bethzy Elonia

    (@east2611)

    I m using this shortcode <?php echo do_shortcode(‘[related_posts_by_tax taxonomies=”brands” post_types=”cars” posts_per_page=”5″ title=”More cars On Similar brands”]’);?> on single-custom-post-type.php i.e single-cars.php below post content. U can see this page https://guitarutha.com/kabira-guitar-chords/ post titles are shown below post content i want to display counts and terms next to post titles shown by ur plugin. I don’t want to link it to archives .

    Thread Starter Bethzy Elonia

    (@east2611)

    the changes i was making in single-hindi-songs.php wasn’t taking by filezilla for dtrange reason, i tried it in the wp appearence editor. it worked.

    Thread Starter Bethzy Elonia

    (@east2611)

    got it resolved. ?? thanks for the great support giving this plugin five star. ??

    if i m right the images are displayed in the table layout. if they can be inserted into a <div> somehow then we can apply the css overflow: hidden; that will crop the extra part of the image.
    like this here

    i don’t think so, the image need space to go somewhere, that’s why you saw the images like they were bedore applying css when they are scaled.
    when you confined them to certan width either they will be a little distorted like you see them now or they will be cropped. but i don’t know how the crop method works. if u r fine with crop method i’ll take a look into it.

    Thread Starter Bethzy Elonia

    (@east2611)

    1> link to page here

    2>yes single-hindi-songs.php is loaded. Below is the whole code of single-hindi-songs.php

    3> Yes do_shortcode() in the template displays the related posts.

    sorry i pasted the wrong single-hindi-songs.php in the previous reply.
    this is the real one. the earlier one was missing (array) after foreach in function.

    <?php get_header(); ?>
    
    <section class="content">
    
    	<div class="page-title pad group">	
    
    	<ul class="meta-single group">
    
    	<?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>
    
    	<li class="comments"><a href="<?php comments_link(); ?>"><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></a></li>
    
    	<?php endif; ?>
    
    	</ul>
    
    	</div>
    
    	<div class="pad group">
    
    		<?php while ( have_posts() ): the_post(); ?>
    
    			<article <?php post_class(); ?>>	
    
    				<div class="post-inner group">
    
    					<h1 class="post-title"><?php the_title(); ?></h1>
    
    					<p class="post-byline">
    
    					<?php _e('by','hueman'); ?> <?php the_author_posts_link(); ?> ·  
    
    					</p>
    
    					<?php if( get_post_format() ) { get_template_part('inc/post-formats'); } ?>
    
    					    <div class="clear"></div>
    
    					<div class="entry-inner">
    
    							<?php
    							// check if the function exists
    							if ( function_exists( 'km_rpbt_related_posts_by_taxonomy' ) ) {
    
    								$args = array(
    									'post_types' => 'hindi-songs',
    									'posts_per_page' => 10,
    
    								);
    
    								$taxonomies = array('version');
    								$post_id = $post->ID;
    								$related_posts = km_rpbt_related_posts_by_taxonomy( $post_id, $taxonomies, $args );
    
    								if ( $related_posts ) {
    
    									echo '<ul>';
    
    									foreach ((array) $related_posts as $related ) {
    
    										echo '<li><a style="color:green;" href="' . get_permalink( $related->ID ) . '">' . $related->post_title . '</a></li>';
    									}
    
    									echo '</ul>';
    								}
    							}
    							?>
    
    							<div class="clear"></div>
    
    							<?php the_content(); ?>
    
    							<?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>
    
    						<?php if ( ot_get_option('sharrre') != 'off' ) { get_template_part('inc/sharrre'); } ?>
    
    						<div class="clear"></div>				
    
    					</div><!--/.entry-->
    
    				</div><!--/.post-inner-->
    
    			</article><!--/.post-->		
    
    <div class= "mysharediv"> 
    
    <?php { echo '<img src="https://eastwst.cf/wp-content/uploads/sharing-tag-line-1.png">'; }; ?>
    
    <?php echo sharing_display(); ?>
    
    </div>
    
    		<?php endwhile; ?>
    
    		<div class="clear"></div>
    
    		<?php the_tags('<p class="post-tags"><span>'.__('Tags:','hueman').'</span> ','','</p>'); ?>
    
    		<?php if ( ( ot_get_option( 'author-bio' ) != 'off' ) && get_the_author_meta( 'description' ) ): ?>
    
    			<div class="author-bio">
    
    				<div class="bio-avatar"><?php echo get_avatar(get_the_author_meta('user_email'),'128'); ?></div>
    
    				<p class="bio-name"><?php the_author_meta('display_name'); ?></p>
    
    				<p class="bio-desc"><?php the_author_meta('description'); ?></p>
    
    				<div class="clear"></div>
    
    			</div>
    
    		<?php endif; ?>
    
    		 <ul class="post-nav group">
    
    		 <li class="next"><?php next_post_link('%link', '<i class="fa fa-chevron-right"></i><strong>'.__('Next song', 'hueman').'</strong> <span>%title</span>'); ?></li>
    
    		 <li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.__('Previous song', 'hueman').'</strong> <span>%title</span>'); ?></li>
    
    		 </ul>
    
    		<?php comments_template('/comments.php',true); ?>
    
    	</div><!--/.pad-->
    
    </section><!--/.content-->
    
    <?php if ( is_singular( array( 'hindi-songs', 'english-songs' ) ) ) { get_template_part('sidebar-hs');} else { get_sidebar();} ?>
    
    	<script async src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    	<script src="/wp-content/themes/childhueman/my-custom-js/jquery.sticky-kit.js" async></script>
    	<script src="/wp-content/themes/childhueman/my-custom-js/collapso-heading.js" async></script>
    
    <?php get_footer(); ?>

    hi rikengct, i visited ur site, if u want forced size box for ur image, you can try it with css, i tried below css on ur site it looks good to me.

    #gallery-2 img {
      border: 2px solid #cfcfcf;
      height: 150px;
    }

    but i don’t know how will you asign a custom class for related posts thumbnails or if there’s any method to include the custom width and height in shortcode in place of “medium” or “post-thumbnail”

    Thread Starter Bethzy Elonia

    (@east2611)

    1> link to page here

    2>yes single-hindi-songs.php is loaded. Below is the whole code of single-hindi-songs.php

    3> Yes do_shortcode() in the template displays the related posts.

    single-hindi-songs.php

    <?php get_header(); ?>
    
    <section class="content">
    
    	<div class="page-title pad group">	
    
    	<ul class="meta-single group">
    
    	<?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>
    
    	<li class="comments"><a href="<?php comments_link(); ?>"><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></a></li>
    
    	<?php endif; ?>
    
    	</ul>
    
    	</div>
    
    	<div class="pad group">
    
    		<?php while ( have_posts() ): the_post(); ?>
    
    			<article <?php post_class(); ?>>	
    
    				<div class="post-inner group">
    
    					<h1 class="post-title"><?php the_title(); ?></h1>
    
    					<p class="post-byline">
    
    					<?php _e('by','hueman'); ?> <?php the_author_posts_link(); ?> ·  
    
    					</p>
    
    					<?php if( get_post_format() ) { get_template_part('inc/post-formats'); } ?>
    
    					    <div class="clear"></div>
    
    					<div class="entry-inner">
    
    							<?php
    							// check if the function exists
    							if ( function_exists( 'km_rpbt_related_posts_by_taxonomy' ) ) {
    
    								$args = array(
    									'post_types' => 'hindi-songs',
    									'posts_per_page' => 10,
    
    								);
    
    								$taxonomies = array('version');
    								$post_id = $post->ID;
    								$related_posts = km_rpbt_related_posts_by_taxonomy( $post_id, $taxonomies, $args );
    
    								if ( $related_posts ) {
    
    									echo '<ul>';
    
    									foreach ( $related_posts as $related ) {
    
    										echo '<li><a style="color:green;" href="' . get_permalink( $related->ID ) . '">' . $related->post_title . '</a></li>';
    									}
    
    									echo '</ul>';
    								}
    							}
    							?>
    
    							<div class="clear"></div>
    
    							<?php the_content(); ?>
    
    							<?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>
    
    						<?php if ( ot_get_option('sharrre') != 'off' ) { get_template_part('inc/sharrre'); } ?>
    
    						<div class="clear"></div>				
    
    					</div><!--/.entry-->
    
    				</div><!--/.post-inner-->
    
    			</article><!--/.post-->		
    
    <div class= "mysharediv"> 
    
    <?php { echo '<img src="https://eastwst.cf/wp-content/uploads/sharing-tag-line-1.png">'; }; ?>
    
    <?php echo sharing_display(); ?>
    
    </div>
    
    		<?php endwhile; ?>
    
    		<div class="clear"></div>
    
    		<?php the_tags('<p class="post-tags"><span>'.__('Tags:','hueman').'</span> ','','</p>'); ?>
    
    		<?php if ( ( ot_get_option( 'author-bio' ) != 'off' ) && get_the_author_meta( 'description' ) ): ?>
    
    			<div class="author-bio">
    
    				<div class="bio-avatar"><?php echo get_avatar(get_the_author_meta('user_email'),'128'); ?></div>
    
    				<p class="bio-name"><?php the_author_meta('display_name'); ?></p>
    
    				<p class="bio-desc"><?php the_author_meta('description'); ?></p>
    
    				<div class="clear"></div>
    
    			</div>
    
    		<?php endif; ?>
    
    		 <ul class="post-nav group">
    
    		 <li class="next"><?php next_post_link('%link', '<i class="fa fa-chevron-right"></i><strong>'.__('Next song', 'hueman').'</strong> <span>%title</span>'); ?></li>
    
    		 <li class="previous"><?php previous_post_link('%link', '<i class="fa fa-chevron-left"></i><strong>'.__('Previous song', 'hueman').'</strong> <span>%title</span>'); ?></li>
    
    		 </ul>
    
    		<?php comments_template('/comments.php',true); ?>
    
    	</div><!--/.pad-->
    
    </section><!--/.content-->
    
    <?php if ( is_singular( array( 'hindi-songs', 'english-songs' ) ) ) { get_template_part('sidebar-hs');} else { get_sidebar();} ?>
    
    	<script async src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    	<script src="/wp-content/themes/childhueman/my-custom-js/jquery.sticky-kit.js" async></script>
    	<script src="/wp-content/themes/childhueman/my-custom-js/collapso-heading.js" async></script>
    
    <?php get_footer(); ?>

    Thread Starter Bethzy Elonia

    (@east2611)

    no it doesn’t display anything the output is pure blank.. Can u please tell me ur email id.. I’ll send u username and password.. If u can take a close look.. Thanks for giving ur precious time.

Viewing 15 replies - 1 through 15 (of 19 total)