Support

Account

Home Forums Backend Issues (wp-admin) Add HTML/WYSIWYG field to Custom Post Type

Solved

Add HTML/WYSIWYG field to Custom Post Type

  • I’m trying to add a basic HTML/WYSIWYG content area into my one of my custom post type pages, so my client easily can add custom content via the normal WordPress admin create/edit post area.

    I will hopefully then be able to call that content on specific pages in a special sidebar, via php.

    I’m using ACF for other things so naturally thougth it would be possible to do this relatively simple thing.

    Cheers

  • Hi @udapud

    In the admin at the bottom underneath where you are adding the new HTML / WYSIWYG fields there should be an area called ‘location’ here you can set rules which decide where the new fields you have just created will appear.

    You will need to select ‘Post Type’ – ‘is equal to’ – ‘NAME OF YOUR CUSTOM POST TYPE’

    When your client edits one of the custom posts they will see the new WYSIWYG.

    You can call it in the custom post template with

    the_field('YOUR FIELD NAME')

    Hope this helps
    Rich

  • Awesome Rich thanks, culmination of a long day and not realising I had chosen the “AND” rule instead of the “OR” rule, as I had two rules for two custom post types.

    Thanks again

  • @udapud you’re welcome, glad its working!

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

The topic ‘Add HTML/WYSIWYG field to Custom Post Type’ is closed to new replies.