Tag Info

Hot answers tagged

3

You can do some tricky thing with PHP. Here is the algorithm you could use. Query posts to get posts as alphabetical order. for/while loop starts. $t = Get first character of the title string. $temp = '' empty string. if $t != $temp echo $t. set $t = $temp. endfor/endwhile. Hope it make sense. The main idea is you check the first character of the title ...


3

It sounds to me like genre should be its own taxonomy. Then posts get assigned to both categories and genres. If you do it this way, here's what you need to do to get everything working: First, register the taxonomy genre. Next, assuming you're using the core posts and categories, go to Settings → Permalinks. Set your permalinks to be ...


2

I would suggest using Scribu's Posts 2 Posts plugin. It allows you to map posts to other posts as if they were a taxonomy like categories. The reason you would do it this way is that your categories for TV series etc... wouldn't have the kind of rich data you want attached to them and it'd be difficult to assign them to multiple genres otherwise. Plus as ...


2

I've found a solution! <?php // Get current Category $get_current_cat = get_term_by('name', single_cat_title('',false), 'category'); $current_cat = $get_current_cat->term_id; // List posts by the terms for a custom taxonomy of any post type $post_type = 'myposttype'; $tax = 'mytaxonomy'; $tax_terms = get_terms( $tax, ...


2

Not sure how you want to handle groups, but it could just be user_meta. Regardless, you could use Gravity Forms + user registration add-on to process a user registration and determine what group the user should be added to. This should work even if you are using third-party hooks. If it's simple user_meta, you can just check for that wherever you want to ...


1

I have updated wordpress 3.4.1 to wordpress 3.9.1 also i have updated all plugin version now code is working without any warning and error.


1

Your filter will result in SQL query with GROUP BY statement but without aggregate function. This will result in displaying only the first row that appear in the group that match your query and omitting the subsequent rows. Read this question for more details. If you want to order your results by post_type, you can hook to posts_orderby filter instead: ...


1

DISCLAIMER : Not a WordPress Expert, Just an old MySQL DBA Here is your original generated SQL SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND ( ( ...


1

I found out I could just group it by wp_postmeta.meta_value on it's own (without wp_posts.ID) and it worked! So it ended up becoming as follows. The PHP: add_filter("posts_groupby", "foo_posts_groupby"); function foo_posts_groupby( $groupby) { if (!is_admin() && is_home()) { return "wp_postmeta.meta_value"; } return $groupby; } ...


1

I'd recommend creating 3 separate ['associated_items'] fields instead of 1. For Example: ['associated_articles'] & "Filter for taxonomy term: Articles" ['associated_presentations'] & "Filter for taxonomy term: Presentations" ['associated_news'] & "Filter for taxonomy term: News" Note: Filtering for the taxonomy term, limits the related ...



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