Automatically Configure Graphene Settings for Multisite Installation
-
Bottom Line: Need to know how to set certain options via PHP or a script to automate multisite configuration.
Background: I have setup WordPress 5.0 with the Graphene theme version 2.5.2. This is Multisite install that will have all sites created with wildcard subdomains. A Graphene child theme was created so some customizations may be easily made and propagated to the subdomain sites. I have developed a plugin with a Network Administrator section so that after a new site is created, a script runs to setup the site look and feel, and populate it with an initial set of pages, menu structure, widgets, posts and some All in One Event Calendar custom posts.
I was able to determine some of the settings that are saved in an array and saved to the WordPress options table for the Graphene settings and Graphene child theme mods. There are a few settings that I have been unable to track down and need help so that I may either use a WordPress function to activate them, or do a brute force database insertion or updates to configure these settings. Below are items set using the Graphene theme settings screens. If anyone has information on how these may be set via WordPress functions, or database queries using PHP, it would be greatly appreciated. The list below refers to the Graphene theme customizing menu structure.
- Site Identity – Site Icon – I have a 512×512 image that is in the media library and have both the postID and file locations available. How can this be set as the site icon programmatically? I know how to do a favicon, but want to take advantage of the features built in to WordPress when it uses the Site Logo.
- Menus – I automatically generate the menus via a PHP script. In order to display my auto generated menu, a menu must be created with no pages assigned and this menu assigned to the Header Menu. How can that part be set programmatically?
- Graphene General – Infinite Scroll – The check box for Click-to-load needs to be set. How can that part be set programmatically?
Widgets – Right Sidebar – There are widgets that need to be added to the right sidebar and configured. How can that part be set programmatically?
The site is a work in progress and may be viewed at the main page for Crew Manager. There is a test site on the subdomain that I’ve been using to debug the install scripts. This may or may not be up if you go to this link.
I’d appreciate any information that could be provided so I know where these settings are stored and how they might be updated via programming.
Admin
Site Icon, Menus, and Widgets are all saved by WordPress. They are not managed by Graphene, so you will need to find out how WordPress saves them in the database, and add those entries manually.
For Graphene’s Infinite Scroll, you can set them following the example below:
/* Code to run on site setup */ global $graphene_settings; $graphene_settings = graphene_get_settings(); $graphene_settings['inf_scroll_method'] = 'click'; update_option( 'graphene_settings', $graphene_settings );
Thanks for the infinite scroll tip Syahir. I’ll do some more searching to see how the other settings may be controlled.
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.