Forum Replies Created
-
AuthorPosts
-
March 24, 2015 at 4:07 am in reply to: How To Remove Automatic Placement Into Custom Post Types #269WebtechideasKeymaster
With the latest version, you will get the option to set the post types where you want to show the buttons. You need to specify the post types as comma separated values.
WebtechideasKeymasterWe have sent a fresh copy of this plugin and please overwrite this on your server. You need to do a fresh like for any post. It will show “[username] posted an update n minutes ago.” as a heading but inside that the content will be shown as “[username] liked [post title]”. With the latest changes in Buddypress, the like activity does not show up as mentioned in the doc.
Thanks
WebtechideasKeymasterPlease allow us couple of days to look for any feasible solution.
WebtechideasKeymasterThe function
GetWtiUserLikes
needs to be slightly modified to allow this. Open wti_like_post.php file using any editor and search for the above function.You need to change
$users[] = $user_info->display_name;
to$users[] = apply_filters( 'wti_like_post_user_profile_link', $user_info->display_name, $user_id );
This will allow attaching a function to the filter to modify the default output. Now let’s define a function related to the above filter as below.
add_filter('wti_like_post_user_profile_link', 'WtiLikePostUserProfileLink', 10, 2); function WtiLikePostUserProfileLink($display_name, $user_id) { return bp_core_get_userlink( $user_id ); }
Please note that if you are logged in and have liked a post, then it will show
You
instead of your display name where you have liked. If you want to change that as well, then change$users[] = __('You', 'wti-like-post');
to$users[] = apply_filters( 'wti_like_post_user_profile_link', __('You', 'wti-like-post'), $current_user->ID);
For more details on the above function which gives you the buddypress profile link, please check here.
Thanks
WebtechideasKeymasterYou can do this in 2 ways.
You can disable the plugin css by setting
Use plugin css file
to No. Then copy this plugin’s css code and put inside theme’s css file. Now modify this css code to load images from your site. This approach allows you to achieve the result without touching the plugin files.You can also achieve the same thing by modifying the plugin css file
wti_like_post.css
present insidecss
folder. You can put your images inside theimages
folder and reference them from the css file.In either case, you can refer the coding available for the
Style1
so that it will be easier for you to code.Thanks
- This reply was modified 9 years, 10 months ago by Webtechideas.
WebtechideasKeymasterThere is setting Voting Period to disable multiple votings from the same user. Set it to Only Once. If the problem still persists, then please share the site url so that we can have a look at the issue.
WebtechideasKeymasterYou can allow multiple voting using the settings available. If it’s a fresh vote, then that will be entered as a new row in the table otherwise existing matching record will be updated with the new vote count and voting date and time. So you can not have the 1st date of the vote rather only the last date of voting.
WebtechideasKeymasterBy raw queries I mean using simple queries without using wordpress specific functions as you mentioned.
WebtechideasKeymasterThis should work for you and you do not need to use this each time you add a post. Using
query_posts
orWP_Query
is the better approach. Another way will be using raw queries. If you need that, then we will need some time to prepare that. Please confirm whether the existing approach works for you or not. Thanks..WebtechideasKeymasterI assume you have not made much modifications to our script. The script picks the posts which have like count as meta data. So if a post does not have this meta data, then it won’t be shown. If you were using the lite version prior to using this pro version, then it’s likely that some posts might have missed out the meta data. Those posts which have recorded fresh votings will surely have the meta data and show up.
You will find a button
Update Like Meta
on the plugin configuration page. Use this button to update the like meta data. This will result in having meta data for all posts and the posts will show up with the script you are using.Note:
– Since this will modify the post data, please have a database back up before proceeding.Thanks
WebtechideasKeymasterThis is not yet possible. Would like to know how the entire process will work as per you.
WebtechideasKeymasterApology for this delayed reply. My Most Liked Posts is not directly possible with WP_Query. You will have to first get the post ids for the user from our table and then pass those ids to the WP_Query to get the desired result.
Not sure whats the issue you are referring with the “nothing found” you have mentioned. Can you please share your site link so that we can have a look at that and suggest a fix.
WebtechideasKeymasterThere will be no changes in the $args, only changes are with the loop and and reset. Please find the code below.
<?php // Get the last voted time based on a week $last_voted_time = GetWtiLastDate('7'); // Query to get all posts sorted by like count after a specific date $the_query = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 5, 'meta_key' => '_wti_like_count', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'meta_query' => array( array( 'key' => '_wti_last_voted_time', 'value' => $last_voted_time, 'type' => 'DATETIME', 'compare' => '>=' ) ) ) ); if ( $the_query->have_posts() ) : ?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <article> <header class="entry-header"> <h1 class="entry-title"><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h1> </header> <div class="entry-content"><?php the_content(); ?></div> </article> <?php endwhile; ?> <?php else : ?> <article> <header class="entry-header"> <h1 class="entry-title"><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h1> </header> <div class="entry-content"><?php _e( 'Nothing Found', 'wti-like-post' ); ?></div> </article> <?php endif; /* Restore original Post Data */ wp_reset_postdata(); ?>
Thanks
WebtechideasKeymasterWith the current implementation, it may not be possible. Even though you can place
GetWtiLikePost()
inside the widget, it will pick up the post id for the page that is currently loaded not the post for which you have put the code.WebtechideasKeymasterApology for not getting back on this in time. I am afraid this is not possible. This is because when the vote is registered, then we store the time of voting and on consequent votes by the same user, we just update the voting count and time. So in such case, you will be able to get the last voted time only not the previous voting times.
-
AuthorPosts