• Resolved hastibe

    (@hastibe)


    WP Job Manager has been a fantastic plugin–we’ve really been appreciating it!

    We were wondering, though, how can we have the company website link open in a new tab on the single job listing pages, instead of opening in the same window?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello @hastibe
    Yes, you can edit template “content-single-job_listing-company.php” (before copy it to your theme)

    And change in line 30:
    <a class="website" href="<?php echo esc_url( $website ); ?>" rel="nofollow"><?php esc_html_e( 'Website', 'wp-job-manager' ); ?></a>

    for:

    <a class="website" target="_blank" href="<?php echo esc_url( $website ); ?>" rel="nofollow"><?php esc_html_e( 'Website', 'wp-job-manager' ); ?></a>

    More info about edit template:
    https://wpjobmanager.com/document/template-overrides/

    Grettings.

    Thread Starter hastibe

    (@hastibe)

    Perfect! Thank you so much! (And to the WP Job Manager developers: I suggest making the company website link open in a new tab the default.)

    Thread Starter hastibe

    (@hastibe)

    @kibus90 – oh, would you also be able to share the edit to make the location link (to the Google map of the location of the job that is entered) open in a new tab, as well?

    Hi @hastibe ,

    here you are:

    <a href="https://maps.apple.com/?q=<?php $address= rawurlencode(get_post_meta( $post->ID, '_job_location', true )); echo $address;?>" target="_blank"><?php get_post_meta( $post->ID, '_job_location', true );?></a>

    Grettings,
    Dariusz.

    Thread Starter hastibe

    (@hastibe)

    @kibus90 – thanks, but could you tell me where I should put this code? Also, you mean maps.google.com, not maps.apple.com, right?

    @hastibe

    No, no – I meant maps.apple.com – then when somone click on it, the iPhone it will open it the Apple Maps, on the Android it will be open in Google Maps etc. ??

    So… open you file:

    content-single-job_listing-meta.php

    Then in the line 37 this:

    <li class="location"><?php the_job_location(); ?></li>
    

    change for:
    <li class="location"><a href="https://maps.apple.com/?q=<?php $address= rawurlencode(get_post_meta( $post->ID, '_job_location', true )); echo $address;?>" target="_blank"><?php the_job_location(false); ?></a></li>

    And now the link will be gonna open in the new tab.

    Grettings, Dariusz.

    Thread Starter hastibe

    (@hastibe)

    That’s very cool–thanks so much, @kibus90!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Way to Have Company Website Link Open in New Tab?’ is closed to new replies.