• Resolved Spidersaw

    (@spidersaw)


    Hello, I’ve done multiple tries to integrate OCDI in my theme by putting this into my functions.php file:

    function ocdi_register_plugins( $plugins ) {
      $theme_plugins = [
        [ // A www.ads-software.com plugin repository example.
          'name'     => 'Advanced Custom Fields', // Name of the plugin.
          'slug'     => 'advanced-custom-fields', // Plugin slug - the same as on www.ads-software.com plugin repository.
          'required' => true,                     // If the plugin is required or not.
        ],
      ];
     
      return array_merge( $plugins, $theme_plugins );
    }
    add_filter( 'ocdi/register_plugins', 'ocdi_register_plugins' );

    But wheter I include a required plugin, theme, xlm file or not, OCDI always acts like there’s nothing to import.
    In the import demo page I receive the following message:

    There are no predefined import files available for this theme. Please upload the import files manually below.

    And that happens with any theme, how can I solve that?

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi @spidersaw,

    with the above code you provided, you are only letting OCDI know that your theme requires the ACF plugin.

    In order to define predefined demo import items, you have to follow this instruction: https://ocdi.com/quick-integration-guide/#define-theme-demos

    Actually, please read the whole page above and you should be able to prepare a predefined demo for your theme.

    Take care!

    Thread Starter Spidersaw

    (@spidersaw)

    Yes, but by putting that code into my functions.php, OCDI says there’s no plugin to import from anywhere. I was wondering if the file I uploaded the code was wrong or not.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @spidersaw,

    the plugins you register with ocdi/register_plugins hook will only show up when one of your predefined demos is selected for import.

    Just after a predefined demo is selected for import, there is an “Install required plugins” step. And after that step, the import will be executed.

    Take care!

    Thread Starter Spidersaw

    (@spidersaw)

    My dear, I’ve:
    – Chosen my theme with ocdi/register_plugins in his functions.php and a valid plugin name and slug, plus it was set as required.
    – Gone into /wp-admin/themes.php?page=one-click-demo-import and received the message”There are no predefined import files available for this theme. Please upload the import files manually below.”

    everything was implemented as I said in the initial question and nothing is showing in the demo import section, I can only manually import content.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @spidersaw,

    as I mentioned in my previous message, the ocdi/register_plugins code only works in connection with the predefined demo imports. So your theme would need to have some predefined demo imports configured with this hook: ocdi/import_files (example: https://ocdi.com/quick-integration-guide/#define-theme-demos).

    Once your theme has at least one predefined demos configured and you would select that demo item, the “Install required and recommended” plugins would show up (if they are not already installed and active, in that case, this plugin installation step would be skipped).

    Take care!

    Thread Starter Spidersaw

    (@spidersaw)

    Thank you very much, I resolved my problem by setting up the import files ??

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @spidersaw,

    I’m glad you resolved your issue ??

    Have a nice day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘OCDI theme integration’ is closed to new replies.