New Topic

Reply To: post template with the content area also templated…

Home › Forum › Customization › post template with the content area also templated… › Reply To: post template with the content area also templated…

#2428

StartupWP
Support

It looks like the easiest solution for this is found here:

http://www.codesynthesis.co.uk/tutorials/adding-custom-fields-to-a-custom-page-template-in-wordpress

1. Duplicate page.php, naming it something else, perhaps donate.php, then add this to the top of the file:

<?php /* Template Name: Donate */ ?>

As well as the following where you want the custom content to appear:

<?php echo get_post_meta( $post->ID, 'about', true ); ?>

2. Install this plugin:

https://wordpress.org/plugins/advanced-custom-fields/installation/

3. Set up the plugin:

– Click on ‘Custom Fields’ on the left hand admin menu
– Click ‘Add new’
– Under ‘Location’ set the rule to ‘Page Template’ is ‘Equal to’ ‘My custom template’
– Above the location section click ‘Add field’ and enter the field name. For this demonstration we’ll call the field name ‘custom_about’ with a field type of ‘wysiwig editor’
– Give the field group a name at the top, in this demo I’ve called it ‘Extra’
– Click ‘Publish’ on the right hand side

This may not be the most complete solution for exactly what you’re looking to do, but should get you started. If you need more help we may be able to provide it, but please keep in mind this is a very advanced customization request and may be outside the scope of what we can reasonably assist with.

Thank you.