Search code examples
wordpressthemescustomization

How to add Views Counter to my Job Portal


How to add Views Counter to my Job posts in Superio Wordpress Theme. This is job portal wordpress theme, purchased in themeforest. When i post jobs, the theme shows many options like: salary, date, location, description etc, but it does not show how many people have visited that job. IF there is possibility to add directly in custom fields or install any plugin that can count visits in every job i post.

I have tried to see if its included as options in theme, but i could not find.


Solution

  • you can use a plugin like Post Views Counter.

    1. Install and activate the Post views counter plugin.
    2. Go to the Post views counter plugin settings.
    3. Go to the general Tab and set the count view for the post.
    4. And go to the display tab and set the display location.
    5. save the plugin settings.
    6. Open the job post type and add a new custom field called views and set the value as 0.
    7. and set the below code in your job template.

    $post_views = get_post_meta( get_the_ID(), 'views', true );
    if ( empty( $post_views ) ) {
      $post_views = 0;
    }
    echo $post_views . ' views';