Temanızı “WordPress Video Tube Plugin” eklentisi ile nasıl uyumlu hale getirebilirsiniz?
WordPress Video Tube Plugin, herhangi bir siteden hızlı ve kolay bir şekilde video eklemek için kullanılan bir Video Barındırma Eklentisidir ve kendi video tüpünüzü veya video galeri sitenizi oluşturmanıza yardımcı olur.
Eklenti bizim tarafımızdan oluşturuldu çünkü bir video galerisi oluşturmanıza yardımcı olacak ücretsiz eklentiler yoktu ve ücretsiz olanlar onu kesmedi.
WPOven'da zaten birkaç tıklamayla sitenize kurulmaya hazır uyumlu premium video temalarımız var ( Kodlama bilgisi veya düzenleme gerekmez ).
Ancak biraz düzenleme konusunda rahatsanız ve bunu kendiniz yapmayı tercih ediyorsanız, aşağıdaki öğreticiyi takip edebilir ve temanızı wpbase-video ile uyumlu hale getirebilir veya kendi temamız olan BA-Tube temamızı deneyebilirsiniz. WordPress Video Tube Plugin ile zaten %100 uyumlu olan ücretsiz.
Aşağıdaki basit adımları kullanarak herhangi bir video temasını wpbase-video ile uyumlu hale getirebilirsiniz:
Kopyalamaya başlamadan önce wpbase-video eklenti klasöründen (yani /wp-content/plugins/wpbase-video) tema klasörünüze (yani /wp-content/themes/ your-theme-name ) aşağıdaki dosyalar:
- /wp-içerik/eklentiler/wpbase-video/css/ videocss.css
- /wp-content/plugins/wpbase-video/images/ timebg.png
Videolarınıza derecelendirme eklemek için WP-PostRatings eklentisini kullanmanızı öneririz.
Ana sayfayı uyumlu hale getirme:
1. Ön sayfadaki küçük resim kodunu (genellikle tema klasörünüzdeki “index.php”) şununla değiştirin:
|
1
2
3
4
5
6
7
8
9
|
< a href = ” <?php the_permalink ( ) ; ?> “ rel = “bookmark” >
<?php if ( has_post_thumbnail ( ) ) { ?>
<?php the_post_thumbnail ( ‘entry-thumb’ , array ( ‘class’ = > ‘entry-thumb’ ) ) ; ?>
<?php } else { ?>
<?php $img_url = get_post_meta ( get_the_ID ( ) , ‘video-thumb’ , TRUE ) ; ?>
<?php if ( $img_url ! = null ) { ?> < img width = “320” height = “240” src = ” <?php echo $img_url ; ?> “ alt = ” <?php the_title ( ) ; ?> “ class = “entry-thumb” / > <?php } ?>
<?php } ?>
< / a >
|
2. Küçük resimlere Zaman ekleyin:
Devamında, küçük resim kodunun bittiği yere aşağıdaki kodu kopyalayın:
|
1
2
3
4
5
6
7
8
9
|
<?php if ( get_post_meta ( get_the_ID ( ) , ‘video-time’ , true ) ) { ?>
< small class = “time” > <?php
if ( ( get_post_meta ( get_the_ID ( ) , ‘video-time’ , true ) ) > 3599 ) {
echo gmdate ( “H:i:s” , get_post_meta ( get_the_ID ( ) , ‘video-time’ , true ) ) ;
} else {
echo gmdate ( “i:s” , get_post_meta ( get_the_ID ( ) , ‘video-time’ , true ) ) ;
}
?> < / small >
<?php } ?>
|
3. Ana sayfaya video görünümleri eklemek istiyorsanız:
index.php dosyasına aşağıdaki kodu ekleyin:
|
1
|
< div class = “entry-meta” > < span class = “entry-comment” > Views : <?php do_action ( ‘dispview’ ) ; ?> < / span > < / div > < ! — . entry – meta — >
|
4. Videolar için Derecelendirme ekleyin ( WP-PostRatings eklentisiyle çalışır) :
|
1
2
3
|
<?php if ( function_exists ( ‘the_ratings’ ) ) {
the_ratings ( ) ;
} ?>
|
TEK YAYIN SAYFASI veya Tek Video sayfasının görüntülenmesi (genellikle single.php'dir) uyumlu hale getirmek :
1. Video Ekle (Kod göm):
|
1
2
3
4
5
6
7
8
9
10
11
12
|
<?php
$embed = get_post_meta ( get_the_ID ( ) , ‘video-code’ , TRUE ) ;
if ( $embed ) {
?>
< div class = “entry-embed” >
<?php //echo wp_oembed_get( $embed, array( ‘width’ => 400 ) );
echo stripslashes ( htmlspecialchars_decode ( $embed ) ) ;
?>
< / div > < ! — . entry – embed — >
<?php
}
?>
|
2. Video için görüntüleme, zaman ve derecelendirme ekleyin
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
< span class = “entry-comment” >
Views : <?php //echo do_shortcode(‘[post_view]’);
do_action ( ‘custhook’ ) ;
?>
< / span >
< span class = “entry-comment” style = “padding-right:10px” >
Length : <?php
if ( ( get_post_meta ( $post – > ID , ‘video-time’ , true ) ) > = 3600 ) {
echo gmdate ( “H:i:s” , get_post_meta ( $post – > ID , ‘video-time’ , true ) ) ;
} else {
echo gmdate ( “i:s” , get_post_meta ( $post – > ID , ‘video-time’ , true ) ) ;
}
?>
< / span >
<?php if ( function_exists ( ‘the_ratings’ ) ) {
the_ratings ( ) ;
} ?>
|

3. Videonun açıklamasını kısaltın (yani 'daha fazla görüntüle' veya 'daha az görüntüle' seçenekleri):
|
1
2
3
4
5
6
7
8
9
10
|
<?php
$permalink = ‘ <a class=”desc-a-vid”>Read More…</a>’ ;
$truncateContent = truncate:: doTruncate ( strip_tags ( get_the_content ( ) , “” ) , 300 , ‘.’ , $permalink ) ; ?>
< div class = “desc-p-vid” >
<?php echo $truncateContent ; ?>
< / div >
< div class = “desc-p-cont” style = “display: none” >
<?php the_content ( ) ; ?>
< a class = “hide-vid” > Read Less < / a >
< / div >
|
ve bunu tema klasöründeki function.php dosyasına ekleyin:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
class truncate {
public static function doTruncate ( $truncateString , $limit , $break = “.” , $pad = “…” ) {
// return with no change if string is shorter than $limit if (strlen($truncateString) <= $limit)
return $truncateString ;
// is $break present between $limit and the end of the string?
if ( false ! == ( $breakpoint = strpos ( $truncateString , $break , $limit ) ) ) {
if ( $breakpoint < ( strlen ( $truncateString ) ) – 1 ) {
$truncateString = substr ( $truncateString , 0 , $breakpoint ) . $pad ;
}
}
return $truncateString ;
}
}
|
ve aşağıdaki javascript'i ekleyin:
|
1
2
3
4
5
6
7
8
9
10
|
jQuery ( “.desc-a-vid” ) . click ( function ( ) {
jQuery ( “.desc-p-vid” ) . hide ( ) ;
jQuery ( “.desc-p-cont” ) . show ( 700 ) ;
jQuery ( “.desc-a-vid” ) . hide ( ) ;
} ) ;
jQuery ( “.hide-vid” ) . click ( function ( ) {
jQuery ( “.desc-p-cont” ) . hide ( ) ;
jQuery ( “.desc-p-vid” ) . show ( ) ;
jQuery ( “.desc-a-vid” ) . show ( ) ;
} ) ;
|
Her şey yapıldı ama şeyleri doğru yerde veya doğru boyutta göremiyor musunuz?
videocss.css dosyasını açın ve “ //bu acc'ı temaya göre ayarlayın” yorumunu içeren satırların değerlerini ayarlayın .
Hala sizin için çalışmasını sağlayamıyor musunuz?
WPOven kullanıcılarına ücretsiz destek veriyoruz, sadece bize bir bilet bırakın ve size yardımcı olmaktan memnuniyet duyarız.
ev borcu WordPress sitesi