New answers tagged

0

There are two ways to solve this: 1 Keep the mods as they are and use get_theme_mod in stead of get_option 2 Store the mods as options by changing the setting: $wp_customize->add_setting( 'social_link_facebook' , array( 'default' => '', 'type' => 'option' ) );


0

If space were the only problem you could simply enqueue a css file to the admin area with these lines to expand the width of the customizer panel from the usual 300px to 500px: .wp-full-overlay-sidebar {width 500px !important;} .wp-full-overlay.expanded {margin-left:500px !important;} Hey, you could even enqueue a js file to insert a button to toggle ...


1

One alternative approach us to have a PHP file that gets the theme options and outputs the CSS and enqueue that directly instead. eg. wp_enqueue_style('custom-css',trailingslashit(get_template_directory_uri()).'styles.php'); This may seem like a strange thing to do at first, but since actually writing a new file should be done via the WP Filesystem for ...


3

The only directory with guaranteed write access is the upload directory. Everything else might be protected. Nowadays, we deploy sites with Composer, keep everything under version control and create completely new sites with each deploy in order to be able to roll back the deployed site. That means that the directory will be created completely new with ...


9

Best place is the uploads directory - it'll be writable by the server, and it's the defacto directory for storing any user-generated/uploaded files: $dirs = wp_upload_dir(); $path = $dirs['basedir']; // /path/to/wordpress/wp-content/uploads


0

I think the best place to write to is to add a folder in the wp-content folder. Here you can write your css files without it is being overwritten when you have a theme update or have a WP update.


-1

You can create using page builders as well as using widgets or you can use custom post types and create page templates for different pages of your custom WordPress theme website.



Top 50 recent answers are included