No, the code isn't right. Per my understanding, the aim of that filter is to build a query for a Slider, right? So, please let me know how you want this query, what kind of comparison do you want? For example, posts that wpcf-case-story-text is equal to "123". As soon as you informa the desired query, I'll build that for you.
That sounds promising, but I'm not 100% sure I understand what information I need to provide. I'll give it a try. Please let me know if I need to provide something else. Also wp-types already has a login which I can provide in a secure environment.
The custom post type slug is case-story
post_type=case-story
custom fields for case-story:
case-story-image
case-story-text
published posts id are:
1402
1397
1395
1300
1399
1298
I see no reason why you need the post id's but just in case I posted them here.
<b>I'm pretty sure the 1817 from the soliloquy example refers to the post id OF THE SLIDER (not the post id). </b> Their example says 1234. I've changed it to 1817 to reflect my slider id.
This is the code solioquy provids online in their docs to register my custom fields with their slider: hidden link
Only problem is it's not working as I understand it.
I really appreciate your help.
Also, I keep rereading this sentence: For example, posts that wpcf-case-story-text is equal to "123". Are you sure that's exactly what you meant to say? Grammatically it's throwing me off so I don't know what it means. Apologies.
To be clear, I am NOT trying to build a custom slider from scratch. I've done that a dozen times or more with Views. I really appreciate the features soliloquy has as it is a full-featured slider plugin. Soliloquy has one little function to call the custom fields in your custom post types so you can build a custom post type slider. Their function requires knowledge from Toolset that Soliloquy would not have (how to register custom fields built with Toolset).
That is the piece I'm missing.
The features soliloquy has that I am unable to use with Views are these:
mobile enabled swiping.
thumbnails that are fully responsive.
Even the wonderful thumbnail slider from Flex (downloaded from modules) does not have scalable thumbnails, and when you turn the thumbnails off and replace with next previous nav, all kinds of bad things happen, such as the swipe going away.
If you examine the code on this slider you can see it's querying the custom post type but not the fields. 🙁
hidden link
(Also it's querying only the default wordpress field, the title, but even though it's showing in the inspect element it's not showing in the slider. I thought it was just a css issue at first but css doesn't fix it).
I am pursuing this same issue with soliloquy but they seem lost as to custom fields queried that are created by wp-types. That's why I am asking you.
I don't think you get the purpose of the soliloquy_fc_query_args action. It's just a way to extend the query of the featured posts. As you have custom fields defined with Types, you can edit the default query adding some evaluations for your custom fields.
For example, let's say you are displaying a list of featured Schools, but you also have a custom field called "wpcf-school-category" and you want to filter by it when displaying the featured posts. So you can add something like that:
add_filter( 'soliloquy_fc_query_args', 'tgm_soliloquy_fc_meta_query', 10, 3 );
function tgm_soliloquy_fc_meta_query( $query_args, $id, $data ) {
// If not the proper slider ID, return early (change 1234 to your specific slider ID).
if ( '1234' !== $id ) return $query_args;
$query_args['meta_query'] = array(
array(
'key' => 'wpcf-school-category',
'value' => 'Elementary',
'compare' => '='
)
);
return $query_args;
}
Your featured slider will contains only Schools that has "Elementary" stored in the "wpcf-school-category". Does that make sense?
Your description seems exactly my understanding of the function, but not really a helpful answer. I gave you all the fields so it would just be reassuring to see them in the code to know I am understanding how they fit in.
I'm not "filtering" by the custom fields. If it only does filtering, then it is indeed not the tool or code I need.
But if the function allows for "extending to extend the query" by including the custom fields in my query, then that is what I am attempting.
Since there is little description or commenting on this function, it's harsh to act as if I'm supposed to inherently know if I'm misunderstanding what it's supposed to do.
Take this line, for instance, "By default, custom meta field queries are not part of the Featured Content Addon interface. However, that doesn’t mean that you can’t do them."
That would lead one to believe that you can add custom fields to your query, as well as the custom post type.
Right now it only queries the custom post type but it acts as if the custom fields don't exist.
If the function soliloquy has provided has no intention of adding custom fields to the slider for display, then I would abandon it (that's what it sounds like though).
I would be happy to go back to building sliders with Views if they were swipe enabled on mobile. This is really important from a user perspective - swipe is much more mobile friendly than poking at next and previous nav arrows or searching for tiny thumbnails.