Thank you for your quick answer. Unfortunately the tutorial is not accurate. Probably because it is outdated. regards
Thank you very much for your update, where should i put the code?
Hi,
I have exactly the same request. Unfortunately, I follow steps from the article but my posts.php file haven’t got any line mentioned from it. Here what I’ve got : https://image.noelshack.com/fichiers/2019/19/1/1557150305-codepostsphp.png
Is it normal ?
Thanks in advance,
@dydybetty11 It seem as though you used code from the outdated section. You can undo this and use just the filter.
function custom_um_profile_query_make_posts( $args = array() ) {
// Change the post type to our liking.
$args['post_type'] = 'page';
return $args;
}
add_filter( 'um_profile_query_make_posts', 'custom_um_profile_query_make_posts', 12, 1 );
@nikolas27 I will add an installable zip file but the best way to add the code is through a child-theme or a custom plugin.
Thank you very much it works ! I have one further question. With this code, my post type was replaced. Is it possible to keep the defaut post type and add my custom post ?
Thanks in advance,
Hello, any updates with the installable zip? thanks
@suiteplugins how if I have 2 custom post type
e.g
function custom_um_profile_query_make_posts( $args = array() ) {
// Change the post type to our liking.
$args[‘post_type’] = ‘my_cpt_one’;
$args[‘post_type’] = ‘my_cpt_two’;
return $args;
}
add_filter( ‘um_profile_query_make_posts’, ‘custom_um_profile_query_make_posts’, 12, 1 );
I try use that code but not working if for 2 CPT
thanks befor