Home Forums Xi Theme Discussion & Support Show post widget filtered by custom fields

This topic is: resolved

This topic contains 6 replies, has 3 voices, and was last updated by  themeweaver 4 years, 7 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2685

    Zoltan Fuzessy
    Member
    Post count: 2

    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?

    #2686

    Roger Leitch
    Participant
    Post 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.

    #2687

    themeweaver
    Keymaster
    Post count: 730

    Yes, as Roger suggests I think what you are asking can be handled easily by the WP category feature.

    #2688

    Zoltan Fuzessy
    Member
    Post count: 2

    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!

    #2689

    themeweaver
    Keymaster
    Post count: 730

    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.

    #2690

    Zoltan Fuzessy
    Member
    Post count: 2

    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?

    #2691

    themeweaver
    Keymaster
    Post count: 730

    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.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.