Tag Info

Hot answers tagged

3

I want to suggest you another approach. You can set a meta when you saving a post if its content is less than 140 chars, so then you can simply runs a simple meta query. add_action( 'save_post_post', function( $id, $post ) { if ( $post->post_status !== 'publish' ) return; if ( strlen( $post->post_content <= 140 ) ) { update_post_meta( $id, ...


1

By default hide_empty is true for get_terms. So i guess you must be missing terms which do not have posts. Try this, <?php $terms = get_terms("autorzy", array('orderby' => 'count', 'order' => 'DESC','hide_empty'=>0 )); $count = count($terms); if ( $count > 0 ){ echo "<div>"; foreach ( $terms as $term ) { ?> ...


1

The issue is that there is no taxonomy meta data like there is for posts. ACF taxonomy data is stored serialized in the options table, so it can't be queried like post meta can. You have to load all terms and check the data associated to each one individually. Perhaps a better solution is to create Romance, Action, & Drama parent terms, and make your ...


1

What about using the UNION? Just an example: (SELECT * FROM $wpdb->posts (with JOIN and WHERE as needed)) UNION (SELECT * FROM $wpdb->posts (with WHERE to select pages)) GROUP BY/ORDER BY The select(s) must be in parenthesis to use an order by for the whole union result. As a second option, you can use a plugin to enable the categories and ...


1

From a naming standpoint it seems that the term "filter" would be more appropriate since you are filtering by criteria first and then a sort (directional) is applied when you order. But that's more a naming convention standpoint... From a code structure if you are using the check_for_popular() method in several places then it makes sense to structure it as ...


1

Add the next lines of code to functions.php file within active theme to start session. function example_login() { if ( ! session_id()) { session_start(); } } add_action( 'init', 'example_login' ); and then Use $_SESSION to store the value of $post



Only top voted, non community-wiki answers of a minimum length are eligible