Edit 1: i tried to write a page as a administrator. it worked. but what i mean is, im using event manager. i want to see my events in my profile posts section.
Hi @yumurtakafalar732
You need to modify the UM Posts query to include the events.
Here’s an example that includes the products custom post type to the posts tab.
add_filter("um_profile_query_make_posts","um_061221_query_make_posts");
function um_061221_query_make_posts( $args ){
$args['post_type'] = ['post','products'];
return $args;
}
You should include the slug of your event’s custom post type in line ['post','products','<insert slug here>']
Regards,
i add for “posts.php”
add_filter("um_profile_query_make_posts","um_061221_query_make_posts");
function um_061221_query_make_posts( $args ){
$args['post_type'] = ['post','products', 'events'];
return $args;
}
but same. no change
Hi @yumurtakafalar732
Are you sure that the post type slug is ‘events’? What’s the event calendar plugin you’re using?
Regards,
hi. https://ww.wp.xz.cn/plugins/wp-event-manager/ im using this. (wp-event-manager)
idk what is it. how can i learn? i thought it is “event”
Hi @yumurtakafalar732
I suggest that you contact the WP Event manager and ask if what post type’s slug they are using.
Regards.
i have own slug. i tried
add_filter("um_profile_query_make_posts","um_061221_query_make_posts");
function um_061221_query_make_posts( $args ){
$args['post_type'] = ['post', 'ik'];
return $args;
}
ik is my category slug. but i cannot see any things. are u sure your code? am i right? i tried to write for templates>profile>posts.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
add_filter("um_profile_query_make_posts","um_061221_query_make_posts");
function um_061221_query_make_posts( $args ){
$args['post_type'] = ['post', 'ik'];
return $args;
}
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
//Only for AJAX loading posts
if ( ! empty( $posts ) ) {
foreach ( $posts as $post ) {
UM()->get_template( 'profile/posts-single.php', '', array( 'post' => $post ), true );
}
Hi @yumurtakafalar732
Category/Taxonomy is different from the Post Type. You can try creating a custom post type with this plugin: https://ww.wp.xz.cn/plugins/custom-post-type-ui/
Regards,
Hi @yumurtakafalar732
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂
Regards,
I still haven’t figured out how to filter by what I want. The plugin you mentioned doesn’t work.