WordPress.org

Ready to get started?Download WordPress

Forums

Recent Tweets Widget
[resolved] Including widget in theme (6 posts)

  1. WP_dj
    Member
    Posted 1 year ago #

    Hi, awesome work.

    I'm trying to include it in my theme through:

    include_once('inc/widgets/recent-tweets-widget/recent-tweets.php';)

    in functions.php, just like I usually do with any other plugin, but for some reason the widget doesn't appear. It does if I install the plugin as normal. Any hint on that?

    Thank you

    dj

    http://wordpress.org/extend/plugins/recent-tweets-widget/

  2. ThemePrince
    Member
    Plugin Author

    Posted 1 year ago #

    Hey, thanks!

    There can be many reasons why it doesn't appear. Sorry if I may sound harsh but it's your task to figure it out in your code. :) I should see it, play with it, but I really don't have time for that. Sorry.

  3. WP_dj
    Member
    Posted 1 year ago #

    I create themes (and provide support) so I totally understand do not worry.

    By the way just had to change the action from 'init' to 'widget_init'.

    Thanks again for your work.

  4. sakib000
    Member
    Posted 1 year ago #

    Hello,

    First of all, you also need to place twitteroauth.php in the same directory where recent-tweets.php file is included.

    Secondly, open recent-tweets.php and replace widget registration code with this (code is located at bottom of file)

    // register	widget
    function register_tp_twitter_widget(){
    	register_widget('tp_widget_recent_tweets');
    }
    add_action('widgets_init', 'register_tp_twitter_widget');

    You may also need to replace whole construct function with this code:

    function tp_widget_recent_tweets()
    		{
    			$widget_ops = array('classname' => 'tweets', 'description' => '');
    
    			$control_ops = array('id_base' => 'tweets-widget');
    
    			$this->WP_Widget('tweets-widget', 'Twitter tweets', $widget_ops, $control_ops);
    		}
  5. ThemePrince
    Member
    Plugin Author

    Posted 12 months ago #

    Thanks sakib000 for helping him out with this. :)

  6. Jason818
    Member
    Posted 10 months ago #

    Thank sakib000 just was I was looking for. ThemePrince, great plug in. Many Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.