1

wordpress サイドバーのすべての Twitter ステータス更新には、bit.ly リンクがあります。それらをクリックすると、bit.ly/uniquenumber に移動する代わりに www.domain.com/blog/" http://bit.ly/uniquenumber/ "に移動しようとするため、404 ページが表示されます。 /blog は、WordPress ブログのホームページです。

www.domain.com/blog と引用符を追加して実際のリンクに移動するのを止める簡単な方法はありますか?

どんな助けでも大歓迎です。コードは次のとおりです。

/* These prefixes and suffixes will display before and after the entire block of tweets. */  
        $prefix = ""; // Prefix - some text you want displayed before all your tweets.  
        $suffix = ""; // Suffix - some text you want displayed after all your tweets.  
        $tweetprefix = ""; // Tweet Prefix - some text you want displayed before each tweet.  
        $tweetsuffix = "<br \><br \>"; // Tweet Suffix - some text you want displayed after each tweet.  

        $feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1" . $limit;  

        function parse_feed($feed, $prefix, $tweetprefix, $tweetsuffix, $suffix) {  

        $feed = str_replace("&lt;", "<", $feed);  
        $feed = str_replace("&gt;", ">", $feed);  
        $clean = explode("<content type=\"html\">", $feed);  

        $amount = count($clean) - 1;  

        echo $prefix;  

        for ($i = 1; $i <= $amount; $i++) {  
        echo $tweetsuffix;
        $cleaner = explode("</content>", $clean[$i]);  
        echo $tweetprefix;  
        echo $cleaner[0]; echo $suffix; echo $tweetsuffix;  ?>

        <img src="<?php echo get_bloginfo('template_directory');?>/images/side.png" alt="A line dividing the twitter updates and the open courses listing">
        <?php 
        }    
        echo $suffix;  
        }  

        $twitterFeed = file_get_contents($feed);  
        parse_feed($twitterFeed, $prefix, $tweetprefix, $tweetsuffix, $suffix);  
4

2 に答える 2

1

リンク先がwww.domain.com/blog/"http://bit.ly/uniquenumber/"の場合は、bitly URL の先頭に余分な " があるためです。URL が定義済みのプロトコル (http、https、ftp など) で始まらない場合、ブラウザはそれを現在の URL に追加します。フォルダ。

于 2010-01-13T17:14:04.157 に答える
0

コードを見てコメントで判断せずに、リンクを生成しているプラ​​グインでリンクの形式が正しくないように見えます。おそらく正しく引用されていないため、URL に表示されます。

于 2010-01-13T15:07:34.780 に答える