• I want to set up a button to link to a page in the site. The button has a class. So my question is how to I create a link that includes the class attribute?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Can you be a bit more specific – why do you want the class in the link?

    Thread Starter sueheap

    (@sueheap)

    <?php if (get_option('jr_submit_page_id')) : ?>
    
        <li class="widget widget-submit">
    
    		<?php if (!is_user_logged_in() || (is_user_logged_in() && current_user_can('can_submit_job'))) : ?>
    
            <div>
    
                <a href="<?php echo get_permalink(get_option('jr_submit_page_id')); ?>" class="button"><span><?php _e('Submit a Job','appthemes'); ?></span></a>
    
                <?php if ($text = get_option('jr_jobs_submit_text')) : echo wpautop(wptexturize($text)); else :
    
                    $packs = jr_get_job_packs();
    
                        if (sizeof($packs) == 0) :
    
    	                // display standard pricing
    
    	                $amount = get_option('jr_jobs_listing_cost');
    
    	                if ($amount && $amount>0) : echo '<p class="pricing"><em>'.jr_get_currency($amount).'</em> '.__('for','appthemes').' <em>30 '.__('days','appthemes').'</em></p>'; endif;
    
    	            endif;
    
                endif; ?>
    
            </div>
    
            <?php endif; ?>
    
            <?php if (is_user_logged_in() && current_user_can('can_submit_resume')) : ?>
    
            	<?php if (get_option('jr_allow_job_seekers')=='yes') : ?>
    
            	<?php endif; ?>
    
            <?php endif; ?>
    
        </li>

    I just want it to link to the “Submit Job” page Does that make sense?

    I’m still confused – what’s the HTML output from the above? Or a link to the page where this is.

    Thread Starter sueheap

    (@sueheap)

    <div id="sidebar">
    
    	<ul class="widgets">
    
        <li class="widget widget-submit">
    
            <div>
    
                <a href="" class="button"><span>Submit a Job</span></a>
    
            </div>

    Now its easy to see in the html that it doesnt link to anything but where for the love of God is that spelled out in the php? lol

    The issue appears to be with the permalink (<?php echo get_permalink(get_option(‘jr_submit_page_id’)); ?>).

    What is the value of that option? What is the url supposed to be?

    This is where the link URL should be defined:

    href="<?php echo get_permalink(get_option('jr_submit_page_id')); ?>"

    Where did you get this code?

    Thread Starter sueheap

    (@sueheap)

    Thread Starter sueheap

    (@sueheap)

    This was set up by someone else so I have no idea where the code came from

    Thread Starter sueheap

    (@sueheap)

    Stupid question but can you tell me how? I am not a php expert or I’m not php anything …thanks

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Remember to remove your maintenance mode from your website.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to link’ is closed to new replies.