-
Author
-
July 28, 2015 at 17:53 #70421wilfriedMarseilleParticipant
Hello
I try to add a page part in my single.php to add a like / Disslike with a
<div class=”hr-title hr-long “We are interested in your opinion” and put just under the button like / DissLike.
So I begin with the <?php do_action(‘kleo_show_love’); ?> To try it.This is my post-like-custome in the page-part
COPY CODE<?php /** * Displays social share icons * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ /* Likes */ $like_status = sq_option( 'likes_status', 1 ); $exclude_likes = str_replace(' ', '', trim(strip_tags(sq_option('likes_exclude')))); $exclude_likes_ids = explode( ',', $exclude_likes ); if( in_array( get_the_ID(), $exclude_likes_ids ) ) { $like_status = 0; } if ( $like_status != 1 ) { return; } ?> <section class="main-color container-wrap social-share-wrap"> <div class="container"> <div class="votre-avis"> <div class="hr-title hr-long"><abbr><?php _e("Votre avis nous intéresse", "kleo_framework"); ?></abbr></div> <?php if ( $like_status == 1 ) : ?> <span class="kleo-love"> <?php do_action('kleo_show_love'); ?> </span> <?php endif; ?> <?php endif; ?> </div> </div> </section> And this is my single php
<?php
/**
* The Template for displaying all single posts
*
* @package WordPress
* @subpackage Kleo
* @since Kleo 1.0
*/get_header(); ?>
<?php
//Specific class for post listing */
if ( kleo_postmeta_enabled() ) {
$meta_status = ‘ with-meta’;
add_filter( ‘kleo_main_template_classes’, create_function( ‘$cls’,’$cls .= “‘.$meta_status.'”; return $cls;’ ) );
}/* Related posts logic */
$related = sq_option( ‘related_posts’, 1 );
if ( ! is_singular(‘post’) ) {
$related = sq_option( ‘related_custom_posts’, 0 );
}
//post setting
if(get_cfield( ‘related_posts’) != ” ) {
$related = get_cfield( ‘related_posts’ );
}
?><?php get_template_part( ‘page-parts/general-title-section’ ); ?>
<?php get_template_part( ‘page-parts/general-before-wrap’ );?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?><?php get_template_part( ‘content’, get_post_format() ); ?>
<?php get_template_part( ‘page-parts/posts-validation-like-custom.php’ ); ?>
<?php get_template_part( ‘page-parts/posts-social-share2’ ); ?>
<?php
if( $related == 1 ) {
get_template_part( ‘page-parts/posts-related’ );
}
?><?php
if ( sq_option( ‘post_navigation’, 1 ) == 1 ) :
// Previous/next post navigation.
kleo_post_nav();
endif;
?><!– Begin Comments –>
<?php comments_template( ”, true ); ?>
<!– End Comments –><?php endwhile; ?>
<?php get_template_part(‘page-parts/general-after-wrap’);?>
<?php get_footer(); ?>`
But is not working 🙁
If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 17:56 #70422wilfriedMarseilleParticipantpost-custom-like ( part page )
COPY CODE<?php /** * Displays social share icons * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ /* Likes */ $like_status = sq_option( 'likes_status', 1 ); $exclude_likes = str_replace(' ', '', trim(strip_tags(sq_option('likes_exclude')))); $exclude_likes_ids = explode( ',', $exclude_likes ); if( in_array( get_the_ID(), $exclude_likes_ids ) ) { $like_status = 0; } if ( $like_status != 1 ) { return; } ?> <section class="main-color container-wrap social-share-wrap"> <div class="container"> <div class="votre-avis"> <div class="hr-title hr-long"><abbr><?php _e("Votre avis nous intéresse", "kleo_framework"); ?></abbr></div> <?php if ( $like_status == 1 ) : ?> <span class="kleo-love"> <?php do_action('kleo_show_love'); ?> </span> <?php endif; ?> <?php endif; ?> </div> </div> </section>
And the single.php
COPY CODE<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ get_header(); ?> <?php //Specific class for post listing */ if ( kleo_postmeta_enabled() ) { $meta_status = ' with-meta'; add_filter( 'kleo_main_template_classes', create_function( '$cls','$cls .= "'.$meta_status.'"; return $cls;' ) ); } /* Related posts logic */ $related = sq_option( 'related_posts', 1 ); if ( ! is_singular('post') ) { $related = sq_option( 'related_custom_posts', 0 ); } //post setting if(get_cfield( 'related_posts') != '' ) { $related = get_cfield( 'related_posts' ); } ?> <?php get_template_part( 'page-parts/general-title-section' ); ?> <?php get_template_part( 'page-parts/general-before-wrap' );?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php get_template_part( 'page-parts/posts-validation-like-custom.php' ); ?> <?php get_template_part( 'page-parts/posts-social-share2' ); ?> <?php if( $related == 1 ) { get_template_part( 'page-parts/posts-related' ); } ?> <?php if ( sq_option( 'post_navigation', 1 ) == 1 ) : // Previous/next post navigation. kleo_post_nav(); endif; ?> <!-- Begin Comments --> <?php comments_template( '', true ); ?> <!-- End Comments --> <?php endwhile; ?> <?php get_template_part('page-parts/general-after-wrap');?> <?php get_footer(); ?>
If you love Ableton check my blog :
www.zikrea.comJuly 28, 2015 at 18:53 #70430sharmstrModeratorI dont see a question in there. But I’m guessing the issue is that post-custom-like.php is not displaying, right? If so, it probably because you are calling posts-validation-like-custom.php instead? Please be more specific regarding your issue if I’m wrong.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.