• Hello Takashi,
    1. featured image doesn’t show as thumbnail even though it exists for this post. For the time being I have hidden the thumbnails using CSS

    2. I have placed [ccc_my_favorite_list_custom_template] on a page but nothing happens. I read the thread you gave me, but I am not a PHP programmer so I am not confident with PHP. Do you have any detailed example of how to use the custom template ?
    thanks
    regards
    Nik

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takashi Matsuyama

    (@takashimatsuyama)

    Hello @niksap
    Thank you for your question.

    Question 1 is there an eyecatch present in all posts but not displayed?
    And is it a standard shortcode ([ccc_my_favorite_list_results])?

    Question 2 will place a sample, but it will only be the same as the reference topic.

    This shortcode is It is possible to code your own output results in your theme’s function.php.

    You can add the elements you want to display yourself. If you do not write any elements, nothing will be displayed.

    The [ccc_my_favorite_list_results] has elements pre-populated.

    Thanks

    Plugin Author Takashi Matsuyama

    (@takashimatsuyama)

    Hello @niksap

    About question 2

    This is a simple sample code to write in “your-theme/functions.php”.

    
    function ccc_my_favorite_list_custom_template( $my_favorite_post_id=false ) {
      $args= array(
        'post_type' => 'any',
        'post__in' => $my_favorite_post_id,
        'orderby' => 'post__in',
        'posts_per_page' => -1,
      );
      $the_query = new WP_Query($args);
      if( $the_query->have_posts() ) {
    ?>
    <p id="ccc-favorite-count"><span class="number"><?php echo $the_query->post_count; ?></span></p>
    <div data-ccc_favorite-delete_all=true><a href="#" class="ccc-favorite-post-delete-button">All Delete</a></div>
    <?php
        while( $the_query->have_posts() ) {
          $the_query->the_post();
    ?>
    <div class="list-ccc_favorite">
      if( has_post_thumbnail() ) {
        echo '<img src="'.get_the_post_thumbnail_url($the_query->post->ID, 'thumbnail').'" />';
      } 
      /* 
       * Your custom field
       * Please write the code to output your custom field.
       */
      <h3 class="title-post"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3><!-- /.title-post -->
      <div class="ccc-favorite-post-toggle"><a href="#" class="ccc-favorite-post-toggle-button" data-post_id-ccc_favorite="<?php echo $the_query->post->ID; ?>"><span class="text">Your Text</span></a></div><!-- /.ccc-favorite-post-toggle -->
    </div>
    <?php
        } //endwhile
      } //endif
    } // endfunction
    

    shortcode: [ccc_my_favorite_list_custom_template style="none"]
    style=”none” excludes the default CSS for the list.

    The only important part of this function is the function name (ccc_my_favorite_list_custom_template) and arguments ($my_favorite_post_id).
    After that, you can freely write the necessary elements in the standard WordPress code.

    Please, try it.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fav list customization’ is closed to new replies.