1. Home
  2. ReHub Theme
  3. How to …
  4. How To add favorites posts button

How To add favorites posts button

From 6.0.7 version you have several ways. First way – you can use default thumb meter of theme. Then, create page and insert shortcode:

[rh_get_user_favorites]

Shortcode will support favorites posts for logined users and for guests.

Second way is to use Favorites plugin. Install plugin from WordPress repository with name Favorites.

Open setting page of plugin. In  General settings  disable “Output Plugin CSS“. In  Display Tab  enable your post type, but disable inner checkboxes with “Insert Before Content,  Insert After Content, Show Favorite Count on Post Entry Screen

In button text add such code:

Save <i class="fa fa-heart-o"></i>

In Button Text (Favorited)*

Saved <i class="fa fa-heart"></i>

You can also add another text or icons.

Enable Favorite Count if you want to show count near button, so, button will be also work as “like it

Create page which will be used for user’s page of favorites posts. You can use simple list of favorites posts with adding such shortcode to page:

[user_favorites user_id="" include_links="true" site_id="" post_types=""]

Or, you can set template “Favorites list” in page attributes to make list with thumbnails.

Also, you must exclude this page from cache if you use cache plugins.

How to add icon for favorite page in right part of menu

On some demo sites you can see favorite icon inside menu in right part. No need for any plugin for this. Do next steps. On menu page ( Appearance   Menus ), click on right top corner button (Screen options) and enable there CSS classes. Now, you can add additional CSS class to each menu. Create Menu item for page where you placed output shortcode for favorites posts. Add next CSS class – floatright. In menu title Add title with icon. Example:

<i class="fa fa-heart-o"></i> Wishlist

 

Was this article helpful to you? Yes No

How can we help?