最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - How To Post WordPress Custom Post Types to Twitter via IFTTT

programmeradmin2浏览0评论

I have my wordpress site. Which has the normal "post" and a custom post type "download", I Currently use IFTTT, (If This Then That Service) to post my wordpress posts to Twitter.

The IFTTT recipe works perfectly for my posts, and tweets as soon as I publish any post. You can check my site , and my twitter account is /

The problem is that, this works only for normal wordpress posts. I searched IFTTT for applets to include custom post types, that didn't work, and i can not find a solution on stack exchange also.

How can i use IFTTT, to tweet any new post of post type 'download'

I love IFTTT, and i don't want any plugins that slow down my site. So please provide me with the code, that ensures that my IFTTT applet is triggered for this custom post type also.

I have my wordpress site. Which has the normal "post" and a custom post type "download", I Currently use IFTTT, (If This Then That Service) to post my wordpress posts to Twitter.

The IFTTT recipe works perfectly for my posts, and tweets as soon as I publish any post. You can check my site https://milyin, and my twitter account is https://twitter/milyincrealtors/

The problem is that, this works only for normal wordpress posts. I searched IFTTT for applets to include custom post types, that didn't work, and i can not find a solution on stack exchange also.

How can i use IFTTT, to tweet any new post of post type 'download'

I love IFTTT, and i don't want any plugins that slow down my site. So please provide me with the code, that ensures that my IFTTT applet is triggered for this custom post type also.

Share Improve this question asked Oct 8, 2019 at 10:57 Aditya AgarwalAditya Agarwal 2764 silver badges22 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

IFTTT works from RSS feed, simply including your post in wordpress RSS feed can do the trick...

function add_cpt_to_loop_and_feed( $query ) {
    if ( is_home() && $query->is_main_query() || is_feed() )        
    $query->set( 'post_type', array( 'post', 'download' ) );    
    return $query;
    }

This is the off topic question. But the answer is yes it is possible.

In IFTTT we can use the Feed applet like "Feed to Tweet".

So, Just create the the Feed applet with your custom post type feed URL.

WordPress generates the feed URL for each post type. You can get it as below:

https://yourwebsite/feed/?post_type={post-type-slug}

E.g. Feed URL of custom post type "Shortcode" is

https://wpdigits/feed/?post_type=shortcode

See the Shortcode post type feed URL.

发布评论

评论列表(0)

  1. 暂无评论