1

First time I am working on WordPress CMS but have fair experience in other CMS products such as Umbraco, Tridion , sitecore etc.

I am using ACF (advance custom field) to create the content forms in CMS but I have a requirement to make the content of header and footer section also CMS driven.

For example I have website logo, site banner in the header and few images in the footer sections.I want to provide privilege to our Editors to modify these images (logo, banner and footer images) from CMS interface similar to other content managed via forms created with the help of custom fields of ACF plugin.

I am just thinking to create two pages ( header & footer ) but it looks that with this approach I will not be able to get the header.php and footer.php as the page template. Also it does not seem a good approach to me.

Can somebody suggest me the best approach to achieve this?

2 Answers 2

0

You can create pages header and footer.

In your header.php and footer.php, you just need to call the fields using the ID of the page you created. Check the documentation

If you need to make that editing, available in the fron-end, you can use acf_form. Check the documentation

0
1

You can add an "options" page to the WP admin with this snippet, add it to your functions file.

// acf options page
if( function_exists('acf_add_options_page') ) {
    $option_page = acf_add_options_page(array(
        'menu_title'    => 'Theme Options',
    ));
}

Then create your custom fields in ACF and add them to Theme Options. Call the fields in your header.php and footer.php with this code (change "logo" to your field name)

<?php the_field('logo', 'option'); ?>

These can then be updated in the Options page.

2
  • But I'm not marked as the correct answer :(
    – Mark
    Commented Nov 27, 2017 at 17:02
  • Mark. Really it should be marked as corrected but stack overflow provide option to select only one answer . Let me upvote you.
    – Vinayak
    Commented Nov 28, 2017 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.