March 1, 2012 at 4:43 pm #2685
Hi, first of all, great theme! I am using it with Event Manager (not the built-in) and seems to be working with no issues, only a minor one. Comments are disabled throughout my site but occassionally I see the leave comment box on some pages.
My real question would be, as the title says, how to achieve the show post widget to filter posts by custom fields. E.g. I have a custom field “highlight” and I would want to have a list of posts where “highlight”=yes.
Would you be able to point me to the right direction?March 1, 2012 at 7:46 pm #2686
Roger LeitchParticipantPost count: 56
Could you use an additional category?
Then use cat_id in the shortcode.
I do this so I can have the same item appear in selected places, e.g. a youth article can appear on the youth page and also be featured on the front pages, by ticking the “frontpage” category as well as ticking the “youth” category.March 1, 2012 at 11:24 pm #2687
Yes, as Roger suggests I think what you are asking can be handled easily by the WP category feature.March 2, 2012 at 4:54 am #2688
Thanks guys, it would be the easiest indeed, but the posts I need to “pull” are posts made by Event Manager (locations), not categorisable. I see the show post widget using cat_id. Can it be modified to filter by a custom field?
Thanks!March 2, 2012 at 7:46 am #2689
No, I think you are confusing custom fields with custom posts types.
The Event Manager plugin uses Custom post Types that would require its own widget and shortcode to query and display appropriate data.
Actually our built-in event posts type uses a custom post type too, but we also supply our own show posts equivalent called ‘show events’ and a shortcode too!
The Event Manager must have its own way of letting you query the data it creates, either through a widget or shortcode. If not then it isn’t a lot of use.March 2, 2012 at 8:51 am #2690
Yes, sorry if I wasn’t clear. I added custom attributes (meta-key) to these “posts” generated by Event Manager. So I would be able to get the relevant “posts” by filtering based on these meta-keys, wouldn’t I?March 2, 2012 at 3:51 pm #2691
Not with our show posts shortcode, without some serious php coding.
The “posts” that Event manager creates are not “posts” they are “custom post types”. While they use the same underlying data tables as posts ( and pages, attachments etc), they need their own query. They will also have lots of meta data associated with events that lie outside normal posts. “Pages” and “attachments” are all also stored in the same data tables, but they are all distinct “post types” needing their own query and hence shortcode/widget.
Displaying data from Event Manager requires custom code. You could no doubt use our widgets and shortcode as a starting point, but this is outside the scope of support we can give here.
If you need some assistance with this I’m sure we could do it for you, but this would be at a cost.
You must be logged in to reply to this topic.