Connections-Business-Directory / Connections

Directory Plugin for WordPress
https://connections-pro.com
GNU General Public License v2.0
26 stars 18 forks source link

Featured Entries #220

Open shazahm1 opened 11 years ago

shazahm1 commented 11 years ago

There should be two levels of featured entries, "Featured" and "Featured in Category"

Implementation:

Consider:

shazahm1 commented 10 years ago

Take a look at the code for this: https://tommcfarlin.com/category-sticky-post/

shazahm1 commented 9 years ago

The featured entries should be saved in the wp_options tables as a JSON encoded array. This would mimic bbPress super sticky topic.

https://github.com/wp-plugins/bbpress/blob/master/includes/topics/functions.php#L2051

shazahm1 commented 9 years ago

The featured in category entries should be saved in the entry cn_entry_meta table as a JSON encoded array. This will match how bbpress handles sticky topic within a forum:

https://github.com/wp-plugins/bbpress/blob/master/includes/topics/functions.php#L2035

To do this I can hook into the cn_process_taxonomy-category action to save the meta.

shazahm1 commented 9 years ago

When displaying results, we'll need to account for the featured and featured within category results so limit and page_limit respected. For reference see how bbPress does it:

https://github.com/wp-plugins/bbpress/blob/master/includes/topics/template.php#L141

WP core seems to handle this the same way.

https://github.com/WordPress/WordPress/blob/master/wp-includes/query.php#L3552

shazahm1 commented 9 years ago

The metabox should be a drop down (maybe radio group) with the label of "Featured" with the options:

shazahm1 commented 9 years ago

How should the feature entries be ordered? Obviously "Feature" would display before the "Featured with Category" entry groups. Maybe the sorting should just follow what ever order by is set to.

Since these have to be queried independently, make sure to have filters available for extensions can be made where these can be ordered in a specific order or any of the other custom orders suported by order_by.

shazahm1 commented 9 years ago

Need to make sure to build in the ability to set expiration dates:

ref: http://www.wpbeginner.com/plugins/how-to-add-an-expiration-date-to-sticky-posts-in-wordpress/ https://wordpress.org/plugins/expire-sticky-posts/