Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Chandan Kumar

    (@chandanonline4u)

    Posts already have categorized as tweets. You can do any kind of formatting on base of that.

    Thread Starter Antton

    (@antton)

    Thank you for your fast response! My problem is that I’m mixing normal WP posts and ‘Import Tweets as Posts’ -posts in the same category and that’s why I’m wondering would there be a easy way to alter the ‘import-tweets-as-posts.php’ in a way that before the tweet text that is imported to a post title, there would always be a word ‘Twitter:’. The post title should this way be: ‘Twitter: **imported tweet text**’

    I’m assuming this could be done by modifying something in this part of your code, but because I’m an absolute beginner in this I don’t really know how to do it.

    if(get_option('itap_post_title')){
                $twitter_post_title = get_option('itap_post_title') .' ('. $tweet_id .')';
              } else {
                $twitter_post_title = strip_tags(html_entity_decode($tweet_text));
              }
    
              $data = array(
                'post_content'   => $tweet_text,
                'post_title'     => $twitter_post_title,
                'post_status'    => $twitter_post_status,
                'post_type'      => 'post',
                'post_author'    => 1,
                'post_date'      => $publish_date_time,
                'post_category'  => array( $twitter_posts_category ),
                'comment_status' => 'closed'
              );

    Thank you again!

    Best,
    Antton

    Plugin Author Chandan Kumar

    (@chandanonline4u)

    You should not mix your normal posts with imported tweets. If you need to trash your all imported tweets or make other changes, it will difficult for you. If you assign category to it, you will be able to filter posts by category and make other changes.

    If you still want customize the plugin, following is the code that helps you:

    if(get_option('itap_post_title')){
      $twitter_post_title = get_option('itap_post_title') .' '. strip_tags(html_entity_decode($tweet_text));
    } else {
      $twitter_post_title = strip_tags(html_entity_decode($tweet_text));
    }

    Hope this will help you.

    Plugin Author Chandan Kumar

    (@chandanonline4u)

    I will also implement this in next version.

    Thread Starter Antton

    (@antton)

    Thank you so much! It works perfectly! So cool! And thanks, now I understood how important it is to use the categories correctly as well. : )

    Best,
    Antton

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Twitter Post Title customization’ is closed to new replies.