Support

Account

Home Forums General Issues How can I import ACF content from a CPT to a normal Post?

Helping

How can I import ACF content from a CPT to a normal Post?

  • Hi guys, I was wondering if someone could help me with this.

    I have a Custom Post Type called “discounts”.

    I have 3 “discounts” posts.

    Each post consists of 1 custom field made with ACF where a URL must be placed the name of the field is “link_discounts_1”.

    Now it turns out that in my blog posts I usually place affiliate links, but these links may change over time. So instead of placing each link what I want is to place a shortcode that takes the URL from the CPT “discounts” / post id / “link_discounts_1”.

    Has anyone done something like this that can give me a light on how to do it?

  • You are going to have to build your own shortcode in PHP to do this.

    I would suggest starting here https://developer.wordpress.org/reference/functions/add_shortcode/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.