Jump to content

need help with array to open link in new window


spookify

Recommended Posts

Hi, hopefully someone can help me here cause i have looked for an "href" for my social media icons

in this wordpress theme  but cant find the html for the url's

 

i have this in my theme_options.php

array(
                        'id' => 'facebook_icon_url',
                        'type' => 'text',
                        'title' => __('Facebook Icon Url', 'beat'),
                        'sub_desc' => __('', 'beat'),
                        'desc' => __('Please enter your Facebook page/profile url', 'beat'),
                        'validate' => 'url',
                        'std' => 'http://www.facebook.com'
                        ),

and this is the plug in code:

<?php
    class BE_social_media extends WP_Widget {
        function BE_social_media() {
            $widget_ops = array('classname' => 'social_media', 'description' => __('Display Social Media Icons with links to your social profiles - Choose icons from theme options panel','beat') );
            $this->WP_Widget('social_media', __('Social Media Icons','beat'), $widget_ops);
        }
        function widget($args, $instance) {
            extract($args, EXTR_SKIP);
            echo $before_widget;
            global $beat_options; // Get Backend Options
             $beat_options = get_option('beat');
             $icons_array = array( 'facebook' , 'twitter' , 'linkedin' , 'gplus' , 'rss' , 'dribbble' );
            $output="";
            $title = empty($instance['title']) ? ' ' : apply_filters('title', $instance['title']);
            if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
            $output.='<ul class="social_media_icons clearfix">';
                            foreach($icons_array as $icon){
                                if(isset($beat_options[$icon.'_icon'])){
                                    $output.='<li class="icons">';
                                        $output.='<a href="'.$beat_options[$icon.'_icon_url'].'" class="social_media"><div class="social_media_container"><img src="'.get_bloginfo('template_url').'/img/'.$icon.'.png" target="_BLANK" alt /></div></a>';
                                    $output.='</li>';
                                }
                            }
                    $output.='</ul>';
            echo $output;
            echo $after_widget;
        }
        function update($new_instance, $old_instance) {
            $instance = $old_instance;
            $instance['title'] = strip_tags($new_instance['title']);
            return $instance;
        }
        function form($instance) {
            $instance = wp_parse_args( (array) $instance, array( 'title' => '') );
            $title = strip_tags($instance['title']);
            ?>
                <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title','beat'); ?><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
            <?php
        }
    }
    register_widget('BE_social_media');
?>

Anyone see it?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.