Store JSON in a custom field

Yes! Yes you can! You can use this code to retrieve a stored option: $value = get_post_meta($post->ID,’customfieldname’,true); // where true means only return 1 custom field by this name You can use this code to save a stored option: update_post_meta($post->ID,’customfieldname’,$valuetobestored); The above code will need to be inside the post loop, though you can supply … Read more

What are the options for running custom css and javascript files on a page?

You can use WordPress built in functionality Function Reference/is page and attach a if statement in your script_enqueue() function in your functions.php file. Read more in the Codex: https://codex.wordpress.org/Function_Reference/is_page Here’s an example from a theme I’m building: if (is_page( array(‘mortgage-calculator’, ‘contact’ ) )){ wp_enqueue_script(‘angularjs’, get_template_directory_uri().’/js/angular.min.js’, array(), ‘1.4.1’, true); wp_enqueue_script(‘d3′, get_template_directory_uri().’/js/d3.min.js’, array(), ’10/22/2015′, true); wp_enqueue_script(‘c3-js’, get_template_directory_uri().’/js/c3.min.js’, … Read more

Multisite configuration fails with css/js files

The problem was in the .htaccess file the installation script generated. Specificaly, those two lines: RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) home/itaymoav/dev/lmspages/$2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ home/itaymoav/dev/lmspages/$2 [L] The path in there is the actual path to the files. While it had to be the relative path from root dir of the worpress installation. Or, to put it simply: RewriteRule … Read more