• Resolved zellion

    (@zellion)


    Used hours to get it really nice and wanted to remove the twitter bird and the twitter news and stuff on the first page so thought i tried to figure it out but didnt work ofc… i went in to editor and tried to remove but then the page wont even show now i took this info from the wigdet part of editor. Now i cant figure out where to paste it back, can someone pls help me.

    What file and where should i paste this to get https://www.kaardal.net working again.

    // twitter widget

    class TwitterWidget extends WP_Widget{

    function TwitterWidget(){
    $widget_ops = array(‘classname’ => ‘twitter’, ‘description’ => __( “Shows your latest Twitter updates”,”mystique”) );
    $this->WP_Widget(false, __(‘Mystique | Twitter’,’mystique’), $widget_ops);
    }

    function widget($args, $instance){
    extract($args);

    $title = apply_filters(‘widget_title’, empty($instance[‘title’]) ? ” : $instance[‘title’]);
    $twituser = empty($instance[‘twituser’]) ? ‘WordPress’ : $instance[‘twituser’];
    $twitcount = empty($instance[‘twitcount’]) ? ‘4’ : $instance[‘twitcount’];
    $id = $args[‘widget_id’];
    $nonce = wp_create_nonce(‘gettwitterdata’);

    echo $before_widget;
    if ($title) echo $before_title . $title . $after_title;

    if(get_mystique_option(‘jquery’)): add_action(‘wp_footer’, create_function(”,’echo $output;’));

    ?>

    <script type=”text/javascript”>
    /* <![CDATA[ */

    // init
    jQuery(document).ready(function(){
    jQuery.ajax({ // load tweets trough ajax to avoid waiting for twitter’s response
    type: “post”,url: “<?php bloginfo(‘wpurl’); ?>/wp-admin/admin-ajax.php”,data: { widget_id: ‘<?php echo $id; ?>’, twituser: ‘<?php echo $twituser; ?>’, twitcount: ‘<?php echo $twitcount; ?>’, action: ‘gettwitterdata’, _ajax_nonce: ‘<?php echo $nonce; ?>’ },
    beforeSend: function() {jQuery(“#<?php echo $id; ?> .loading”).show(“slow”);},
    complete: function() { jQuery(“#<?php echo $id; ?> .loading”).hide(“fast”);},
    success: function(html){
    jQuery(“#<?php echo $id; ?>”).html(html);
    jQuery(“#<?php echo $id; ?>”).show(“slow”);

    }
    });
    });
    /* ]]> */
    </script>

    <div class=”twitter-content clearfix” id=”<?php echo $id; ?>”>
    <div class=”loading”><?php _e(“Loading tweets…”,”mystique”); ?></div>
    </div>
    <?php else: ?>
    <p class=”error”><?php _e(“jQuery is disabled and this widget needs it”,”mystique”); ?></p>
    <?php endif; ?>

    <?php if ($title): ?>
    “><span><?php _e(“Follow me on Twitter!”,”mystique”); ?></span>
    <?php endif;

    echo $after_widget;
    }

    function update($new_instance, $old_instance){
    $instance = $old_instance;
    $instance[‘title’] = strip_tags(stripslashes($new_instance[‘title’]));
    $instance[‘twituser’] = strip_tags(stripslashes($new_instance[‘twituser’]));
    $instance[‘twitcount’] = strip_tags(stripslashes($new_instance[‘twitcount’]));
    return $instance;
    }

    function form($instance){
    // defaults
    $instance = wp_parse_args( (array) $instance, array(‘title’=>__(‘My latest tweets’,’mystique’), ‘twituser’=>’Wordpress’, ‘twitcount’=>’4’) );

    $title = htmlspecialchars($instance[‘title’]);
    $twituser = htmlspecialchars($instance[‘twituser’]);
    $twitcount = htmlspecialchars($instance[‘twitcount’]);
    ?>
    <p>
    <label for=”<?php echo $this->get_field_name(‘title’); ?>”> <?php _e(‘Title:’,’mystique’); ?></label>
    <input class=”widefat” id=”<?php echo $this->get_field_id(‘title’); ?>” name=”<?php echo $this->get_field_name(‘title’); ?>” type=”text” value=”<?php echo $title; ?>” />
    </p>

    <p>
    <label for=”<?php echo $this->get_field_name(‘twituser’); ?>”><?php _e(‘Twitter user name:’,’mystique’); ?></label>
    <input class=”widefat” id=”<?php echo $this->get_field_id(‘twituser’); ?>” name=”<?php echo $this->get_field_name(‘twituser’); ?>” type=”text” value=”<?php echo $twituser; ?>” />
    </p>

    <p>
    <label for=”<?php echo $this->get_field_name(‘twitcount’); ?>”><?php _e(‘Number of tweets to show:’,’mystique’); ?></label>
    <input size=”8″ id=”<?php echo $this->get_field_id(‘twitcount’); ?>” name=”<?php echo $this->get_field_name(‘twitcount’); ?>” type=”text” value=”<?php echo $twitcount; ?>” />
    </p>
    <?php
    }
    }

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need help with site’ is closed to new replies.