Querying Posts or One Post

Shortcode: aw2_query_post

Querying one post or page. Get data of the post using aw2_value, aw2_loop_value

Parameters

——————–


id: defaults to default_item . [aw2_value], [aw2_item] also defaults to the same.


cond: any If conditions. If a condition is passed then only runs if the condition is met

Examples

—————–

 

Shortcode: aw2_query_posts

Querying Multiple Posts


Equivalent to get_posts, get_pages, wp_query

Parameters

——————-


id: Defaults to ‘default_collection’ id of the Query. aw2_loop also defaults to default_collection


part: If you want to break the query into parts. Possible Values: main, tax_query, meta_query. If value=main then a new query is created and all existing parts are destroyed. If part is not mentioned the query runs immediately


run: defaults to ‘false’. If set to true will run a query which is in parts


conditions: Use any of the condition parameters in aw2_if. Only executes if the conditions match


query_type: defaults to get_posts. Possible values – get_pages, wp_query. Use wp_query when you require paging


relation: defaults to ‘AND’ . Used in taxonomy and meta query to define the relationship. See http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters


request_taxonomy: Comma Separated String. Can be used to build a series of taxonomy conditions based on request parameters



param_taxonomy: Comma Separated String. Can be used to build a series of taxonomy conditions based on stored variables(aw2_param)


main: if you only want one value from the collection then you can directly put the parameters of aw2_collection to get that value
Returns


———-


Returns a Collection. The collection can be accessed using [aw2_collection] . See Working with Collections to see how to loop through the collection

Examples

—————–