简体   繁体   中英

Social plugin for Wordpress not using 'postname'

I'm looking to use the ' Social ' plugin from MailChimp on a Wordpress blog. Everything is setup fine and it works perfectly, except one aspect.

When I use the 'Broadcast' feature or leave a comment and post to Twitter/Facebook it creates a URL with the 'Post-ID' http://domain.com/blog/?p=1 instead of using the 'postname' http://domain.com/blog/post-name/ which I setup in the permalinks section of Wordpress.

Try changing in file "/wp-content/plugins/social/lib/social/service.php" the line (appears only one time in the file)

$url = wp_get_shortlink($post->ID);

for:

$url = get_post_permalink($post->ID);

You must test carefully that the change doesn't affect any other functionality, maybe contacting to the plugin creator.

您可以使用内置过滤器来创建将调整 URL 格式的插件,但是 ?p=123 样式的 URL 是默认的(强烈推荐),以帮助将更有意义的内容放入广播中。

Even if you manage to match the url's and broadcast it. It still does not works. The problem is only when you use a featured image to broadcast it.

It works better (not 100%) for a post that is broadcasted without a featured image.

The problem is only with facebook. It does a good job with twitter.

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