{"id":20020,"date":"2012-09-24T11:08:51","date_gmt":"2012-09-24T11:08:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/mend-sticky-posts\/"},"modified":"2012-09-25T11:01:06","modified_gmt":"2012-09-25T11:01:06","slug":"mend-sticky-posts","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/mend-sticky-posts\/","author":7718485,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1","stable_tag":"trunk","tested":"3.4.2","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Mend Sticky Posts","header_author":"Martin Shopland","header_description":"","assets_banners_color":"","last_updated":"2012-09-25 11:01:06","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/uk.virginmoneygiving.com\/charity-web\/charity\/finalCharityHomepage.action?charityId=1000496","header_plugin_uri":"http:\/\/www.redbrickstudios.co.uk","header_author_uri":"","rating":5,"author_block_rating":0,"active_installs":10,"downloads":1366,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.1":"<p>This version fixes a bug that could mess up unordered queries. Upgrade immediately.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[3003],"plugin_category":[],"plugin_contributors":[94238],"plugin_business_model":[],"class_list":["post-20020","plugin","type-plugin","status-closed","hentry","plugin_tags-core","plugin_contributors-martinshopland","plugin_committers-martinshopland"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/mend-sticky-posts.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<ul>\n<li>Sticky posts are ordered the same way as non-sticky posts.<\/li>\n<li>Sticky posts do not reappear on subsequent pages.<\/li>\n<li>The first page of home will contain exactly the requested number of posts, rather than the requested number of posts plus the number of sticky posts.<\/li>\n<li>Allows more than one page of sticky posts.<\/li>\n<\/ul>\n\n<p>Simply injects the sticky post IDs into the actual mySQL order by clause, \ncausing posts to be ordered by sticky status then by what ever order is \nspecified, usually post_date DESC, and not to repeat on subsequent pages. \nI can't actually figure out why it isn't done like this by WP, perhaps \nearlier versions of mySQL don't support this. WP's default sticky ordering \ncraziness is turned off by returning an empty array for the next call to\nget_option('sticky_posts') which happens in WP_Query-&gt;get_posts().<\/p>\n\n<p>There is currently a ticket awaiting review on the Wordpress trac system to roll this functionality into the Wordpress core: http:\/\/core.trac.wordpress.org\/ticket\/21986<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>mend-sticky-posts.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>That's it!<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.1<\/h4>\n\n<ul>\n<li>Functionally closer to core code.<\/li>\n<li>Now only run on \"home\" queries.<\/li>\n<li>Only run if ignore_sticky_posts isn't passed to WP_Query.<\/li>\n<li><strong>Bugfix:<\/strong> Doesn't add comma when order by clause is already empty.<\/li>\n<\/ul>","raw_excerpt":"Wordpress&#039;s Sticky Posts behaviour is still incomprehensible, let&#039;s fix it.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/20020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=20020"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/martinshopland"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=20020"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=20020"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=20020"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=20020"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=20020"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=20020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}