Support » Themes and Templates » Adding hyperlinks in home page widgets

  • Resolved vikingdad



    I am trying to make the links in the widgets at the bottom of the homepage (contact, studio, blog) on into clickable hyperlinks.

    When I insert the URL into the widget it just comes out as if it were normal text.

    Does anyone have any idea how I can change this?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Did you try to write it enclosed with <a></a> tag?

    In your case, that would be:

    For email:
    <a href="" title="Email"></a>

    For studio:
    <a href="" title="Studio"></a>

    For shop:
    <a href="" title="Shop"></a>

    Hi Xaliber

    Thanks for the reply.

    Iยดm not 100% sure where to put that tag. In functions.php this is the code for the blog widget.

    class prod_blog extends WP_Widget {
    	function prod_blog() {
    		parent::WP_Widget(false, 'Architekt - Blog');
    	function widget($args, $instance) {
                    $args['blog_title'] = $instance['blog_title'];
    	function update($new_instance, $old_instance) {
    		return $new_instance;
    	function form($instance) {
                    $blog_title = esc_attr($instance['blog_title']);
                    <p><label for="<?php echo $this->get_field_id('blog_title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('blog_title'); ?>" name="<?php echo $this->get_field_name('blog_title'); ?>" type="text" value="<?php echo $blog_title; ?>" /></label></p>
    function prod_func_blog($args = array(), $displayComments = TRUE, $interval = '') {
    	global $wpdb;
            //echo $args['before_widget'] . $args['before_title'] . $args['title'] . $args['after_title'];
            echo $args['before_widget'] . $args['before_title'] . $args['blog_title'] . $args['after_title'];
            $port_args = array(
                         'category_name' => 'blog',
                         'post_type' => 'post',
                         'posts_per_page' => 5
                         //'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
            echo '
            while (have_posts()) : the_post(); ?>        
    <li><a>"><?php the_title(); ?></a></li>
            <?php endwhile; ?>
            echo '</ul>
            echo $args['after_widget'];
    // **** PRODUCTION - BLOG LIST END ****

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

    You said that,

    When I insert the URL into the widget it just comes out as if it were normal text.

    Where do you insert those URL?

    If my presumption is correct, the place where you insert those URL is the same place where you should put the <a></a> I have given above. ๐Ÿ™‚

    Ah yes!

    You are a legend Xaliber. Thanks a lot for your speedy help ๐Ÿ™‚

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding hyperlinks in home page widgets’ is closed to new replies.