michaelm89
Forum Replies Created
-
yes, it’s working like a charm now, thanks π
the update seems to have fixed the problem.
thank you for fast help! πI’ll wait, thanks π
Ps. Woo is enabled on this page :/
thanks for superfast replyhello,
now everything works great, thank you for your support!hello,
still waiting for rankmath update πthanks!
+1
I will be grateful if you can open it. you will certainly describe the problem better than I do.
thank you for your quick answer πThere definitely should be a button “don’t like” for people who do not like the content. Are you planning something like that?
Forum: Plugins
In reply to: [WP Job Manager] City without address in urlI tried to change region to geolocation_city, but without positive effect.
There is nothing in place of city in urlfunction job_listing_post_type_link( $permalink, $post ) {
// Abort if post is not a job
if ( $post->post_type !== ‘job_listing’ ) {
return $permalink;
}// Abort early if the placeholder rewrite tag isn’t in the generated URL
if ( false === strpos( $permalink, ‘%’ ) ) {
return $permalink;
}// Get the custom taxonomy terms in use by this post
$categories = wp_get_post_terms( $post->ID, ‘job_listing_category’, array( ‘orderby’ => ‘parent’, ‘order’ => ‘ASC’ ) );
$regions = wp_get_post_terms( $post->ID, ‘geolocation_city’, array( ‘orderby’ => ‘parent’, ‘order’ => ‘ASC’ ) );if ( empty( $categories ) ) {
// If no terms are assigned to this post, use a string instead (can’t leave the placeholder there)
$job_listing_category = _x( ‘uncategorized’, ‘slug’ );
} else {
// Replace the placeholder rewrite tag with the first term’s slug
$first_term = array_shift( $categories );
$job_listing_category = $first_term->slug;
}if ( empty( $regions ) ) {
// If no terms are assigned to this post, use a string instead (can’t leave the placeholder there)
$job_listing_region = _x( ‘anywhere’, ‘slug’ );
} else {
// Replace the placeholder rewrite tag with the first term’s slug
$first_term = array_shift( $regions );
$job_listing_region = $first_term->slug;
}$find = array(
‘%category%’,
‘%region%’
);$replace = array(
$job_listing_category,
$job_listing_region
);$replace = array_map( ‘sanitize_title’, $replace );
$permalink = str_replace( $find, $replace, $permalink );
return $permalink;
}
add_filter( ‘post_type_link’, ‘job_listing_post_type_link’, 10, 2 );function change_job_listing_slug( $args ) {
$args[‘rewrite’][‘slug’] = ‘job/%category%/%region%’;
return $args;
}
add_filter( ‘register_post_type_job_listing’, ‘change_job_listing_slug’ );function add_region_endpoint_tag() {
add_rewrite_tag( ‘%region%’, ‘([^/]*)’ );
}
add_action( ‘init’, ‘add_region_endpoint_tag’ );