简体   繁体   中英

Where is this HTML closing bracket coming from?

I really have no idea where the > right below the tweet button is coming from:

http://alexchen.info/nojokethistime/

Code:

        <?php while ( have_posts() ) : the_post(); ?>
            <div class="content-block-2">
                <h2><?php the_title(); ?></h2>
                <?php the_content(); ?>

                <div id="photo-credits">
                    <?php _e('Photo Credits: '); ?><a href="<?php echo get_post_meta($post->ID, 'rw_link', true); ?>"><?php echo get_post_meta($post->ID, 'rw_user', true); ?></a>
                </div>

                <?php if (  $wp_query->max_num_pages > 1 ) : ?>
                    <div id="prev"><?php next_posts_link( __( '&larr; previous', 'twentyten' ) ); ?></div>
                    <div id="social-buttons">
                        <div id="tweet-button">
                            <?php echo tweetbutton(); ?>
                        </div>
                        <div id="fb-share"><?php if (function_exists('fbshare_manual')) echo fbshare_manual(); ?></div>
                        <div id=fb-like><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px"></iframe></div>
                    </div>
                    <div id="next"><?php previous_posts_link( __( 'next &rarr;', 'twentyten' ) ); ?></div>
                <?php endif; ?>
            </div>
        <?php endwhile; ?>

EDIT: tweetbutton(); is a function of a Wordpress plugin.

This is its output:

                        <div id="tweet-button"> 
                            <div id="tweetbutton68m" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Falexchen.info%2Fnojokethistime%2Ftaken-away%2F&amp;text=Taken%20Away&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Falexchen.info%2Fnojokethistime%2Ftaken-away%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://alexchen.info/nojokethistime/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>>

It comes from somewhere inside <?php echo tweetbutton(); ?> <?php echo tweetbutton(); ?> . What's in there?

See output from the tweetbutton function in your edited question:

Tweet</a></div>>

A double >>

Looks like tweetbutton() prints &gt; .

<div id="tweetbutton68m" class="tw_button" style="">
 ...
</div>&gt;

I think it's in the code for <?php echo tweetbutton(); ?> <?php echo tweetbutton(); ?> . I see this when I look at the HTML source code of the page you linked (the HTML comments are my own addition for clarity):

<div id="tweet-button">
  <!-- begin <?php echo tweetbutton(); ?> -->
  <div id="tweetbutton68m" class="tw_button" style="">
    <a href="..." class="..." style="...">
      Tweet
    </a>
  </div>>
  <!--  ^^  end <?php echo tweetbutton(); ?> -->
</div>

See the extra > after the closing div .

For future reference: I discovered this easily by simply viewing the Source of the webpage in the web browser, and searching for the text >> inside of the code.

Looks like it's coming from inside tweetbutton() . Here's what the markup looks like rendered:

<div class="tw_button" id="tweetbutton68m">
    <iframe (bunch of stuff)></iframe>
</div>&gt;

And there's the code for the > right at the end ( &gt; )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM