adds a Pages by Template field to Advanced Custom Fields. Select pages by template.
This is an add-on for the Advanced Custom Fields WordPress plugin and will not provide any functionality to WordPress unless Advanced Custom Fields is installed and activated.
The Pages by Template field provides a new kind of field which allows you to choose pages based on their assigned templates (custom templates). When creating the field in ACF you may choose one or multiple templates to display pages from. You can also choose the ability to select one page or more in which the type will change between checkboxes and radio buttons.
The return value is one or more post objects. Display these in the same way you would a Relationship field or Post Object field.
https://github.com/jonathan-dejong/acf_pages_by_template https://github.com/jonathan-dejong/acf_pages_by_template/issues- Download the add-on and copy the folder fields containing the acf_pages-by-template.php file to your theme folder
- Include the
acf_pages-by-template.php
in your theme'sfunctions.php
if( function_exists( 'register_field' ) )
{
register_field('acf_page_template', dirname(File) . '/fields/acf_page_per_template.php');
}
- Create an option to choose all pages
- Create an option to choose the default template