Support

Account

Home Forums General Issues How to activate plugin within theme

Helping

How to activate plugin within theme

  • Dear Elliot:

    Your plugin was the topic of conversation during the past 2 WordPress meetups (MU) in our community (Saint Louis, Missouri, USA). Our MU coordinator successfully used your plugin when developing a WP site for a local community theater. He presented the site and your plugijn as a model for organizing information in a content management system.

    I have a web site I’m developing in which I’d also like to use your plugin. The site is for a travel tour operator who escorts trips to Europe. I’m having trouble integrating the plugin into the theme. I will describe what I’ve done thus far, and my results. Any constructive advice you can offer will be appreciated. If I can get your plugin to work, I have several additional projects on which I’d like to use your plugin. [I’m working on 2 tracks here; I’ve put in a request with our local WP MU coordinator for his help. I’m still waiting back for his response. He’s been unavailable over the recent Christmas holiday.]

    1. I am working in a local development environment running MAMP. With your plugin installed and active locally, I created a field group (FG) called ‘Scheduled Tour’ that contains 8 fields.

    2. I exported the field group to PHP and saved the PHP code in a ‘functions.php’ file. The file was placed in the child theme of my site’s parent theme.

    3. After exporting the FG, I tried to include the FG in my theme by adding an ‘include once()’ function prior to the FG code in my child theme’s functions.php file. [See ‘http://pastebin.com/npasQgDF‘ to view file.] Result: the back-end form for the FG did not appear on my site for any page template type.

    [Note: Does the url relative path stated in the ‘include once()’ function matter? The function is written ‘include once(‘advanced-custom-fields/acf.php’)’. The child theme functions.php file is actually an indirect descendant of the plugin folder. The relative path from the child theme functions.php file to the acf.php file would be ‘../plugins/advanced-custom-fields/acf.php’. ]

    4. I copied the ‘page.php’ template from my parent theme, renamed it ‘single-acf_scheduled-tour.php’, and placed it in my child theme. The inclusion of this file in the child theme had no impact on activating the FG on the back or front end of the site.

    There is a quirk in the operation of the plugin in my local development environment compared with the test environment on my web server. At ‘Custom Fields>Field Groups’, I see my FG listed. When I select ‘edit’, only the last custom field added to the FG is available to edit. By comparison, in the test environment on my web server, ‘edit FG’ presents all 8 custom fields for editing. Don’t know if this is a bug or not. Locally, I can export the entire FG (8 fields) to XML or PHP. I just can’t edit the entire FG without deleting it and starting over. Thought you’d be interested to know this.

    Robert

  • Hi @rgadon107

    The ‘export to PHP’ feature of ACF is NOT a required part of a website build. I don’t think you should be using this feature yet, if this is the first time using ACF.

    Please note that ACF does not automatically display any data into your template. You need to edit your template files and display the data yourself.

    Please read over the documentation, starting with the ‘getting started’ section.

    Thanks
    E

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

The topic ‘How to activate plugin within theme’ is closed to new replies.