Title: Template
Last modified: February 2, 2021

---

# Template

 *  Resolved [impulsionmedia](https://wordpress.org/support/users/impulsionmedia/)
 * (@impulsionmedia)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/template-59/)
 * Hi,
 * Thanks a lot for the plugin, exactly what i needed. Simple and light.
 * just wondering if it’s possible to customize the list output and use it as a 
   template in our theme. Right now i am actually customizing it in the plugin folder
   which i Think is not that great for eventual updates!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Takashi Matsuyama](https://wordpress.org/support/users/takashimatsuyama/)
 * (@takashimatsuyama)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/template-59/#post-14025619)
 * Hello [@impulsionmedia](https://wordpress.org/support/users/impulsionmedia/),
 * Thank you for your review.
 * I’ve been trying to figure out a way to make the list output more flexible and
   customizable.
 * For example, in a future update, I’ll try to add a shortcode that returns only
   the saved post IDs.
 * I’d like to update it so that it only gets the favorite post IDs and the theme
   can design the list more freely.
 *  Thread Starter [impulsionmedia](https://wordpress.org/support/users/impulsionmedia/)
 * (@impulsionmedia)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/template-59/#post-14085556)
 * Just saw the update… I will try it out shortly… thanks
 *  Plugin Author [Takashi Matsuyama](https://wordpress.org/support/users/takashimatsuyama/)
 * (@takashimatsuyama)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/template-59/#post-14088398)
 * Thanks for your comment.
    Please, try it.
 * 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">
         <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
         <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; ?>"></a></div>
       </div>
       <?php
           } //endwhile
         } //endif
       } // endfunction
       ```
   
 * shortcode: `[ccc_my_favorite_list_custom_template style="none"]`
    `style="none"`
   excludes the default CSS for the list.
 *  Thread Starter [impulsionmedia](https://wordpress.org/support/users/impulsionmedia/)
 * (@impulsionmedia)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/template-59/#post-14190783)
 * Hi, i applied your code to my function page with my layout and used your suggested
   shortcode and everything works. Now i just need to customize it in my OWN function
   page which is fantastic. Greatly appreciated.
 * I added a “else” statement if there are no favorites to add a message. It works
   when you load the list page if they are no favorites already. But if i am in 
   the list page and i remove favorites until there are 0, it does not show the 
   message. it does show the “favorites : 0” count but not my “else” message. If
   i hit the browser refresh button it appears. It’s not a bid deal, just wanted
   to let you know. probably related to ajax or something.
 * Thanks again
    -  This reply was modified 5 years, 6 months ago by [impulsionmedia](https://wordpress.org/support/users/impulsionmedia/).
    -  This reply was modified 5 years, 6 months ago by [impulsionmedia](https://wordpress.org/support/users/impulsionmedia/).
 *  Plugin Author [Takashi Matsuyama](https://wordpress.org/support/users/takashimatsuyama/)
 * (@takashimatsuyama)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/template-59/#post-14237011)
 * Hello [@impulsionmedia](https://wordpress.org/support/users/impulsionmedia/),
   thank you for your review.
 * It is as you say.
    When deleting a favorite on a list page, it is not rewritten
   with Ajax.
 * Because when the delete button is clicked, it is hide just “display:none” of 
   CSS and the counter is rewritten with JS.
    However, when you access this page
   again, it is loaded from the DB with Ajax, so it displays a 0 for message in 
   PHP.
 * I’ll think about a better method as a future task.
    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

 The topic ‘Template’ is closed to new replies.

 * ![](https://ps.w.org/my-favorites/assets/icon.svg?rev=2459439)
 * [My Favorites](https://wordpress.org/plugins/my-favorites/)
 * [Support Threads](https://wordpress.org/support/plugin/my-favorites/)
 * [Active Topics](https://wordpress.org/support/plugin/my-favorites/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-favorites/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-favorites/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Takashi Matsuyama](https://wordpress.org/support/users/takashimatsuyama/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/template-59/#post-14237011)
 * Status: resolved