我正在尝试添加更多的分享按钮到我的wordpress博客。这是它的起源:
<div class="sharing">
<div class="sharing-facebook">
<a data-shareto="<?php _e('Facebook', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo wp_get_shortlink() ?>"><i class="fa fa-facebook"></i></a>
</div>
<div class="sharing-twitter">
<a data-shareto="<?php _e('Twitter', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="https://twitter.com/home?status=<?php echo urlencode( get_the_title() ); ?>%20-%20<?php echo wp_get_shortlink() ?>"><i class="fa fa-twitter"></i></a>
</div>
<div class="sharing-pinterest">
<a data-shareto="<?php _e('Pinterest', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="#" data-href="https://pinterest.com/pin/create/button/?url=<?php echo wp_get_shortlink() ?>&media=<?php echo esc_url( $featured_img ); ?>&description=<?php echo urlencode( get_the_title() ); ?>"><i class="fa fa-pinterest"></i></a>
</div>
<div class="sharing-linkedin">
<a data-shareto="<?php _e('Linkedin', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo wp_get_shortlink() ?>&title=<?php echo urlencode( get_the_title() ) ?>&summary=<?php echo urlencode( wp_strip_all_tags( get_the_excerpt() )) ?>&source=<?php echo urlencode( get_bloginfo( 'name' ) ) ?>"><i class="fa fa-linkedin"></i></a>
</div>
</div>你能告诉我应该怎么做才能在Reddit和Tumblr上添加分享选项吗?
非常感谢你对我的帮助。
顺便说一句,我正在使用主题"Falive“,但他们不提供支持选项来优化外观。我尝试复制其他类的代码行,但都不起作用。
发布于 2019-12-07 14:13:13
我已经编辑了你的代码并添加了reddit & tumblr分享,希望对你有所帮助。
<div class="sharing">
<div class="sharing-facebook">
<a data-shareto="<?php _e('Facebook', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo wp_get_shortlink() ?>"><i class="fa fa-facebook"></i></a>
</div>
<div class="sharing-twitter">
<a data-shareto="<?php _e('Twitter', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="https://twitter.com/home?status=<?php echo urlencode( get_the_title() ); ?>%20-%20<?php echo wp_get_shortlink() ?>"><i class="fa fa-twitter"></i></a>
</div>
<div class="sharing-pinterest">
<a data-shareto="<?php _e('Pinterest', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="#" data-href="https://pinterest.com/pin/create/button/?url=<?php echo wp_get_shortlink() ?>&media=<?php echo esc_url( $featured_img ); ?>&description=<?php echo urlencode( get_the_title() ); ?>"><i class="fa fa-pinterest"></i></a>
</div>
<div class="sharing-linkedin">
<a data-shareto="<?php _e('Linkedin', 'jeg_textdomain') ?>" rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo wp_get_shortlink() ?>&title=<?php echo urlencode( get_the_title() ) ?>&summary=<?php echo urlencode( wp_strip_all_tags( get_the_excerpt() )) ?>&source=<?php echo urlencode( get_bloginfo( 'name' ) ) ?>"><i class="fa fa-linkedin"></i></a>
</div>
<div class="sharing-tumblr">
<a data-shareto="tumblr" rel="nofollow" target="_blank" href="http://www.tumblr.com/share/link?url=<?php echo wp_get_shortlink() ?>"><i class="fab fa- tumblr"></i></a>
</div>
<div class="sharing-reddit">
<a data-shareto="reddit" rel="nofollow" target="_blank" href="https://www.reddit.com/r/test/submit?title=<?php echo the_title() ?>&url=<?php echo wp_get_shortlink() ?>"><i class="fab fa-reddit"></i></a>
</div>
</div>发布于 2019-12-08 16:25:08
你可以使用wordpress网站的AddtoAny插件。
https://stackoverflow.com/questions/59222669
复制相似问题