Forums

Tweet Blender
[resolved] Use custom field to show related tweets (4 posts)

  1. Joris
    Member
    Posted 1 year ago #

    Thank you very much for this cool plugin. It really is perfect! Because many of my posts use a lot of tags, the related tweets are not really related anymore. Therefor I would like to set some extra tags in the custom field. I did it the following way:

    <?php if( get_post_meta($post->ID, "twitter", true)
    <?php
    	    tweet_blender_widget(array(
    	    'unique_div_id' => 'tweetblender-t1',
    	    'sources' => 'echo get_post_meta($post->ID, "twitter", true);',
    	    'refresh_rate' => 60,
    	    'tweets_num' => 5,
    )); ?>	    
    
    <?php endif; ?>

    So in the source I called echo get_post_meta($post->ID, "twitter", true); to get the tags set in the customfield. But this is obviously not the correct way to call it in an array. Could someone help me out with some php tips..?

  2. Joris
    Member
    Posted 1 year ago #

    Found it out myself. I used this code:

    $sources = get_post_meta($post->ID, "twittertags", true);
    
    tweet_blender_widget(array(
        'unique_div_id' => 'tweetblender-t1',
        'sources' => $sources,
        'refresh_rate' => 60,
        'tweets_num' => 5,
    ));

    Where 'twittertag' is the description of the custom field..

  3. HFdesign Webdesign
    Member
    Posted 1 year ago #

    @ Joris, can you also show the code you should replace to use a custom field instead of a tag?

  4. Joris
    Member
    Posted 1 year ago #

    I don't use Tweet Blender anymore, but the standard Twitter widget: http://twitter.com/about/resources/widgets

    Anyway I used the custom field in the code above. I named the custom field "twittertags", so maybe that was a bit confusing...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic