skyline521
Forum Replies Created
-
Forum: Plugins
In reply to: [Frontend Admin by DynamiApps] Modify FormI too am having this issue after updating to ACF 6.1
I answered my own issue yet again. for anyone looking to do this in the future, below I have my PHP snippet for ordering directory listings by custom field for both listings and search, respectively.
add_filter( 'atbdp_all_listings_query_arguments', 'ordby' );
function ordby( $args ) {
$args['post_type'] = 'at_biz_dir';
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = 'urc_rank';
$args['order'] = 'ASC';
return $args;
}add_filter( 'atbdp_listing_search_query_argument', 'ordby' );
function searchordby( $args ) {
$args['post_type'] = 'at_biz_dir';
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = 'urc_rank';
$args['order'] = 'ASC';
return $args;
}@m4hd1bd nevermind the above. I corrected that issue, but now i’ve got another issue where if I go to another page of listings, it’s starting over from the beginning again (1, 2, 3, 4)
add_filter('atbdp_all_listings_query_arguments', 'ordby');
function ordby(){
$args = array(
'post_type' => 'at_biz_dir',
'orderby' => 'meta_value_num',
'meta_key' => 'urc_rank',
'order' => 'ASC',
);
return $args;
}- This reply was modified 2 years, 2 months ago by skyline521.
@m4hd1bd okay so I tried using a custom field and using this php snippet, but for some reason it’s pulling up blog posts and not listings? urc_rank is the custom field and it simply has a number value.
add_filter('atbdp_all_listings_query_arguments', 'ordby');
function ordby(){
$args = array(
'post_type' => 'at_biz_dir',
'orderby' => 'meta_value_num',
'meta_key' => 'urc_rank',
'order' => 'ASC',
);
}Thanks @m4hd1bd, where exactly do I modify the argument? in the plugin files?
Thank you so much @m4hd1bd!
@m4hd1bd THANK YOU! This needs to be implemented in the plugin next update please. Adding this into “additional CSS” worked!