• Hi all,

    I have a big favour to ask you kind people. I have a new site, and at the top of this site there is a button that says “Post A Job” and links to the post a job page. Here is the code for that button:

    <div class="buttons">
    							<div class="menu-btn icon-menu-1 blue-button"></div>
    							<?php
    							if ( !empty( $job_manager_slug ) ) {
    								$post_a_job = true;
    
    								$post_a_job_link = '
    								<div class="postajob">
    									<a href="' . get_permalink( get_page_by_path( $job_manager_slug ) ) . '" class="blue-button">' . __('Post a job', 'vh' ) . '</a>
    								</div>';
    							} else {
    								$post_a_job_link = '';
    								$post_a_job = false;
    							}

    I would like to change this code so the button says “Recruiters” and points to a different link.

    Thanks for any potential help 🙂
    James

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey James,

    Hopefully I can lend a hand.

    This part controls the text: (‘Post a job’, ‘vh’ ), namely the part in between the single quotes: ‘Post a job’ So if you change Post a job there, it should change the button text.

    It looks like the link itself is coming from this variable, which seems to be set somewhere else: $job_manager_slug

    You could either set the variable here in the button code, so right under$post_a_job = true; you could add something like $job_manager_slug = 'http://example.com';, like so:

    $post_a_job = true;
    $job_manager_slug = 'http://example.com';

    Or you can replace the variable in the button link with your url below:

    <a href="' . get_permalink( get_page_by_path( $job_manager_slug ) ) . '" class="blue-button">

    Adding your url instead of . get_permalink( get_page_by_path( $job_manager_slug ) ) ., like you would with a normal html link.

    I hope this helps!

    Thread Starter james2612

    (@james2612)

    Thanks kaisuess for your quick reply.

    I tried both of your ideas and they didnt work 🙁

    Your first suggestion for some reason pointed to the home page. The second gave me a syntax error.

    I have changed the button wording to “Recruiters” – 🙂

    Thanks again

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

The topic ‘Help With Code’ is closed to new replies.