Untuk kasus saya sy oprek di theme wallpaper darko dan sabrina.
Untuk sabrina langsung praktek dengan tutorial dibawah ini:
CARA MEMASANG PIN PINTEREST SECARA MANUAL. PERHATIKAN BAIK BAIK.
ini kodenya taruh di single-attachment.php
<?php echo do_shortcode('[pinit]'); ?>
letakkan kode ditas, dibawah kode ini:
<?php if($smof_data['att_ads']==1 && $smof_data['att_ads_code2']!=''): ?>
<?php echo $smof_data['att_ads_code2']; ?>
<?php endif; ?>
Untuk darko langsung praktek dengan tutorial dibawah ini:
Masuk ke single-attachment.php, ganti dan copy pastekan saja kode berikut ini:
<?php get_header();
global $smof_data;
global $post;
$parent = get_post($post->post_parent);
$parent_id = $parent->ID;
$no_dash_tit = preg_replace('/[-_]/',' ', $post->post_title);
?>
<?php $attach = wp_get_attachment($attachment->ID);?>
<?php if ($smof_data['attachment_layout'] == "full"):?>
<div class="single attachment <?php echo $smof_data['attachment_layout'];?>" style="width: 100%;">
<?php quantum_breadcrumbs();?>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title">
<?php echo $no_dash_tit; ?>
</h1>
</header>
<div class="single-content post-body" style="width:100%">
<?php if($smof_data['att_ads']==1 && $smof_data['att_ads_code']!=''): ?>
<?php echo $smof_data['att_ads_code']; ?>
<?php endif; ?>
<?php if ($smof_data['att_autodesc']==1 && $smof_data['top_att_auto']==1) {
$attachments = get_posts( array(
'post_type' => 'attachment',
'posts_per_page' => -1,
'post_parent' => $parent_id,
'exclude' => get_post_thumbnail_id()
) );
//print_r($attachments);
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
//$title = wp_get_attachment_link( $attachment->ID, false );
$title = $attachment->post_title;
$titlearray[]=$title;
//$content .= $title;
}
$title_comma= implode(', ', $titlearray);
}
//echo $title_comma;
echo do_shortcode($smof_data['top_autodesc_code']);
} ?>
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject" class="image-wrap" style="width: 100%;">
<?php //twentythirteen_the_attached_image();
echo wp_get_attachment_link( $attachment->ID, 'full', true );
$att_gbr_link = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
?>
<meta itemprop="url" content="<?php echo $att_gbr_link[0]; ?>" /><meta itemprop="width" content="<?php echo $att_gbr_link[1];?>">
<meta itemprop="height" content="<?php echo $att_gbr_link[2];?>">
<ul class="gallery-detail">
<li><i class="icon-picture"></i><?php _e('Wallpaper:','quantum');?> <?php echo $no_dash_tit; ?></li>
<li><i class="icon-folder-open"></i><?php
$cat = get_the_category($post->post_parent);
echo $cat[0]->cat_name;
?>
<li><i class="icon-time"></i><?php the_time('F j, Y');?></li>
<?php if (function_exists('the_views')):?>
<li><i class="icon-eye-open"></i><?php the_views();?></li>
<?php endif;?>
</ul>
</div>
<?php echo viral_download_one();?>
<?php if ($attach['caption'] !== "" OR $attach['description']!=="") { ?>
<div class="desc">
<?php
echo $attach['caption'];
echo '<br />';
echo $attach['description'];?>
</div>
<?php } ?>
<?php if($smof_data['att_ads']==1 && $smof_data['att_ads_code2']!=''): ?>
<?php echo $smof_data['att_ads_code2']; ?>
<?php endif; ?>
<?php if($smof_data['parent_auto'] == 1):
//Grab parent post, remove image and caption shortcode
ob_start();
echo $parent->post_content;
$only_content = preg_replace('/<img[^>]+./','', ob_get_contents());
ob_end_clean();
ob_start();
echo $only_content;
$new_string = preg_replace('#\s*\[caption[^]]*\].*?\[/caption\]\s*#is', '', $only_content);
ob_end_clean();
echo '<p>'.$new_string.'</p>';
endif;?>
<?php if ($smof_data['att_autodesc']==1 && $smof_data['bottom_att_auto']==1) {
echo do_shortcode($smof_data['bott_autodesc_code']);
} ?>
<?php //include('includes/social-share.php');?>
<div class="prev-next">
<span class="prev full"><?php previous_image_link( false, '<i class="icon-double-angle-left"></i> Previous Image ' ); ?></span>
<span class="next full"><?php Next_image_link( false, 'Next Image <i class="icon-double-angle-right"></i>' ); ?></span>
</div>
<h2>
<?php _e( '« Back to Post : ', 'wpquantum' );
echo '<a href="' . get_permalink($parent) . '">'.$parent->post_title . '</a> ' . $delimiter . ' ';?>
</h2>
<div class="gallery-wrap" style="width: 100%;float: left;">
<?php echo do_shortcode('[gallery columns="5" id="' . intval( $post->post_parent ) . '"]'); ?>
</div>
</div>
</article>
</div>
<?php endwhile; endif?>
<?php else:?>
<div class="single">
<?php quantum_breadcrumbs();?>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title">
<?php echo $no_dash_tit; ?>
</h1>
</header>
<div class="single-content post-body">
<?php if($smof_data['att_ads']==1 && $smof_data['att_ads_code']!=''): ?>
<?php echo $smof_data['att_ads_code']; ?>
<?php endif; ?>
<?php if ($smof_data['att_autodesc']==1 && $smof_data['top_att_auto']==1) {
echo do_shortcode($smof_data['top_autodesc_code']);
} ?>
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject" class="image-wrap" style="width: 100%;" class="image-wrap">
<?php echo wp_get_attachment_link( $attachment->ID, 'full', true );
$att_gbr_link = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
?>
<meta itemprop="url" content="<?php echo $att_gbr_link[0]; ?>" /><meta itemprop="width" content="<?php echo $att_gbr_link[1];?>">
<meta itemprop="height" content="<?php echo $att_gbr_link[2];?>">
</div>
<?php if($smof_data['att_ads']==1 && $smof_data['att_ads_code2']!=''): ?>
<?php echo $smof_data['att_ads_code2']; ?>
<?php endif; ?>
<br>
<?php _e('Title:','quantum');?> <?php echo $no_dash_tit;?>
Uploaded in category: <?php
$cat = get_the_category($post->post_parent);
echo $cat[0]->cat_name;
?>
. Time upload: <?php the_time('F j, Y');?>
<?php if (function_exists('the_views')):?>
. Views: <?php the_views();?>
<?php endif;?>
<?php if ($attach['caption'] !== "" OR $attach['description']!=="") { ?>
<div class="desc">
<?php
echo $attach['caption'];
echo '<br />';
echo $attach['description'];?>
</div>
<?php } ?>
<?php if($smof_data['parent_auto'] == 1):
//Grab parent post, remove image and caption shortcode
ob_start();
echo $parent->post_content;
$only_content = preg_replace('/<img[^>]+./','', ob_get_contents());
ob_end_clean();
ob_start();
echo $only_content;
$new_string = preg_replace('#\s*\[caption[^]]*\].*?\[/caption\]\s*#is', '', $only_content);
ob_end_clean();
echo '<p>'.$new_string.'</p>';
endif;
//the_content();
?>
<?php if ($smof_data['att_autodesc']==1 && $smof_data['bottom_att_auto']==1) {
echo do_shortcode($smof_data['bott_autodesc_code']);
} ?>
<?php //include('includes/social-share.php');?>
<?php echo do_shortcode('[pinit]'); ?>
<div class="prev-next">
<span class="prev full"><?php previous_image_link( false, '<i class="icon-double-angle-left"></i> Previous Image ' ); ?></span>
<span class="next full"><?php Next_image_link( false, 'Next Image <i class="icon-double-angle-right"></i>' ); ?></span>
</div>
<h2>
<?php _e( '« Back to Post : ', 'wpquantum' );
echo '<a href="' . get_permalink($parent) . '">'.$parent->post_title . '</a> ' . $delimiter . ' ';?>
</h2>
<div class="gallery-wrap">
<?php echo do_shortcode('[gallery columns="5" id="' . intval( $post->post_parent ) . '"]'); ?>
</div>
</div>
</article>
</div>
<?php endwhile; endif; ?>
<?php get_sidebar();
endif;
get_footer(); ?>
SELESAI
0 Response to "Cara Menaruh Tombol Share Button Pinterest di Theme Darko dan Sabrina Versi Mas Pingi"
Posting Komentar