Showing regions variables in WP Job Manager Plugin

#1603
  • Resolved shahid irfan
    Rank Math free

    Hi, I am using WP Job manager theme. I want to show custom taxonomy region in the title of the job, but it does not show variables for it. How can I add custom taxonomy variables in job posting titles.

    It also gives this error while authorizing with Google Console.

    400. That’s an error.

    Error: invalid_scope

    Some requested scopes were invalid. {invalid=[//www.googleapis.com/auth/analytics, //www.googleapis.com/auth/webmasters, //www.googleapis.com/auth/analytics.edit, //www.googleapis.com/auth/adsense.readonly]}

    Learn more

    Request Details
    That’s all we know.

    • This topic was modified 5 years, 1 month ago by shahid irfan.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Todd
    Rank Math free

    Hello Shahid,

    Thanks for getting in touch.

    Does the plugin you use offer any variable that you can use in the meta title? If so, have you tried entering that in WordPress Dashboard > Rank Math > Titles & Meta > Pages/Posts?

    We are looking into the GSC error you are seeing. I will get back to you ASAP on that.

    shahid irfan
    Rank Math free

    This variable shows in Yoast SEO, but not in rankmath SEO plugin. I used this taxonomy for showing regions in Yoast SEO.

    %%ct_job_listing_region%%

    Hello,

    Which Job Manager theme are you using?

    It also gives this error while authorizing with Google Console.

    400. That’s an error.

    Can you please add your login details in the Sensitive Data Section so we can check this issue.

    Looking forward to helping you. Thank you.

    shahid irfan
    Rank Math free

    I am using Jobify theme. Its custom taxonomy works fine with Yoast. But, not showing in rankmath.

    I am providing login details for further check.

    Hello,

    You can use the plugin filter code to add new variables. Please try adding below code in your theme’s functions.php file:

    
    add_action( 'rank_math/vars/register_extra_replacements', function() {
    
    	RankMath\Helper::register_var_replacement(
    			'job_region',
    			'get_regions',
    			array(
    				'name'    => esc_html__( 'Job Regions.', 'rank-math' ),
    				'desc'    => esc_html__( 'Job Region of the current job', 'rank-math' ),
    				'example' => get_job_region(),
    			)
    		);
    });
    
    function get_job_region() {
    	$post_id = isset( $_GET['post'] ) ? $_GET['post'] : get_queried_object_id();
    	if ( ! $post_id && ( ! is_singular( 'job_listing' ) ) ) {
    		return null;
    	}
    
    	$regions = wp_get_post_terms( $post_id, 'job_listing_region', array( 'fields' => 'names', 'number' => 1 ) );
    	if ( empty( $regions ) ) {
    		return null;
    	}
    
    	return $regions[0];
    }
    

    After adding this filter, you will see a new placeholder %job_region% in the list.

    The Google Search console authorization is working fine on your site. Can you add screenshot of the error in the Sensitive Data Section?

    Looking forward to helping you. Thank you.

    Rank Math Bot
    Rank Math free

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this ticket.