pend00
Forum Replies Created
-
Forum: Plugins
In reply to: [Contextual Related Posts] Fatal error in plugin@ajay I’ve changed
get_crp_posts_id
toget_crp_posts
and updated the plugin and everything works as expected now. Thank you!Forum: Developing with WordPress
In reply to: Contributor role cant remove postThank you for your help! I’ll try to find another way, not using wp’s delete post link.
Forum: Developing with WordPress
In reply to: Contributor role cant remove postIf I give Contributors the right to “Manage Options” it works. What do Manage Options do? Would it be a risk to allow site users to have that right? I’m hiding the Dashboard menu bar at the top and they are not allowed to edit the dashboard.
Forum: Developing with WordPress
In reply to: Contributor role cant remove post@bcworkz I’ve made my custom post types with the Pods plugin. In the Pods settings for that custom post type, it was set to use Posts capabilities. I’ve changed it to have its own custom post type capabilities and selected the appropriate ones in Members, but it still doesn’t work.
@wpcoworker I will try and see if that works. What will the outcome be? That the Contributor role will lose all capabilities or does it go deeper than that?
Thank you for your replies.
Forum: Plugins
In reply to: [WP ULike - All-in-One Engagement Toolkit] Sort by likes with “orderby”I’ll answer my own question if someone needs help with this in the future.
You can simply add
?orderby=’date’&order=’dsc'
at the end of an archive URL and WordPress will recognize it and order the archive accordingly. However, this doesn’t work with properties that aren’t predefined by WordPress, so doing something like?orderby=’likes’&order=’dsc'
will do nothing.But you can check for the value of
orderby
in a PHP function before the archive is generated and if it is ‘likes’ then modify the query. ULike has a function to get posts sorted by likes,wp_ulike_get_popular_items_ids()
. So my code at the end looked like this (it’s a bit simplified for demonstration):HTML:
<select name="sort" id="sort" onchange="document.location.href=\'?\' + this.options[this.selectedIndex].value" class="archive_sort_dropdown"> [...] <option value="orderby=likes" class="archive_sort_dropdown_item" >Most liked</option> [...] </select>
PHP:
add_action('pre_get_posts', 'most_liked_query'); function most_liked_query($query) { if($_GET['orderby'] == 'likes'){ $post__in = wp_ulike_get_popular_items_ids(array( "rel_type" => 'article', //post type "period" => 'all', //all time, I think you can set week, day etc "limit" => 0 //how many posts to get, I think 0 is all posts )); $query-> set('post__in', $post__in); $query-> set('orderby', 'post__in'); return $query; } }
- This reply was modified 3 years, 9 months ago by pend00.
Hi!
Thank you for a quick reply! The thing is that I would like the user to come to the newly created post, that make sense. But I want to show a message as an overlay or similar.When editing a post a message is shown on Update. Is there something like that but for submit.
Thank you!
Forum: Plugins
In reply to: [SSL Certificate - Free SSL, HTTPS by SSL Zen] HELP! Crash after update!I managed to remove the plugin by simply deleting the SSL Zen folder from wordpress’ plugin folder via ftp. It solves it. Tried to reinstall it and the crash happened again, so there seems to be a critical issue with the latest update.
The earliest issue regarding this seems to be 1019 and it is about a year old. Do you have any insight if this is a feature that is planned or not. I might have to look for other solutions if it is not.
Thank you!
I have the same problem. The correct value for my likes is shown in the admin tools and on my custom post pages. But sorting on most likes won’t work. For me
wp_ulike_get_popular_items_ids
returns nothing.