WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] clickable header image (3 posts)

  1. vball
    Member
    Posted 1 year ago #

    I'm trying to make the header image clickable so it send you to another site. currently it is clickable but takes you to the current site.
    I thought I had found the code and updated it correctly but when clicked the path it sends you to is the current site url then the url of the site I want it to go to.. below is the code with the link I want it to go to

    <div id="template">
    	<div id="header" onclick="location.href='www.craigtechinc.com/ADMC.htm';" style="cursor: pointer;">
    		<?php
    		/* $head_text = '<div id="head-title">' . get_bloginfo('name') . '</div><div id="head-description">' . get_bloginfo('description') . '</div>'; */
    		$head_text = '<div id="head-title"></div><div id="head-description">' . get_bloginfo('description') . '</div>';

    [Please post code snippets between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    the url of the site is http://www.craigtechmachineandtool.com
    the URL of the site I want it to send you when you click on the header image, http://www.craigtechinc.com/ADMC.htm
    the url it currently sends you to using the above code
    http://www.craigtechmachineandtool.com/www.craigtechinc.com/ADMC.htm

    I can't figure out why it's inserting the current url in addition to the one of the page I want it to go to.
    any help would be greatly appreciated. I didn't create the site, I was just asked to do some updates but I ahve very little WP experience and less with php..

  2. W.P. Ginfo
    Member
    Posted 1 year ago #

    Hi vball

    when typing the url's make sure you use the complete syntax: 'http://www.craigtechinc.com/ADMC.htm'

  3. vball
    Member
    Posted 1 year ago #

    thank you so much, that did the trick.. I didn't even notice I hadn't put that !! I was so busy looking for a hard solution I didn't see the simple one..

Topic Closed

This topic has been closed to new replies.

About this Topic