Plugin path comes wrongly
To solve this problem, we must use plugin_dir_url command. For example: <?php wp_register_style( ‘foo-styles’, plugin_dir_url( __FILE__ ) . ‘dahili/bootstrap.min.css’ ); wp_enqueue_style( ‘foo-styles’ ); ?>
To solve this problem, we must use plugin_dir_url command. For example: <?php wp_register_style( ‘foo-styles’, plugin_dir_url( __FILE__ ) . ‘dahili/bootstrap.min.css’ ); wp_enqueue_style( ‘foo-styles’ ); ?>
In PHP, it’s not necessary to post to a PHP file, it is only required to include ( or require ) files and then use checks and validations to ensure that code is only processed when required. You simply need to include the PHP file as part of your application – it will process the … Read more
If you want to change the permalink structure for all Pages (i.e. posts of the page type), you can use the WP_Rewrite::$page_structure property like so: add_action( ‘init’, ‘wpse_382911′ ); function wpse_382911() { global $wp_rewrite; $wp_rewrite->page_structure=”home/%pagename%”; } Don’t forget to flush the rewrite rules — just visit the permalink settings admin page (wp-admin → Settings → … Read more
Until this gets fixed, the only workaround I can see is to intercept the $_POST data and add extra slashes prior to ACF stripping them: /** * @link http://wordpress.stackexchange.com/q/143555/1685 */ function wpse_143555_acf_add_slashes() { if ( ! empty( $_POST[‘fields’] ) ) { foreach ( $_POST[‘fields’] as $k => $v ) { if ( ! is_array( $v … Read more
You will want to run a find-and-replace script across the database to update all URLs to reflect the new domain. Just because you change the WordPress settings doesn’t mean the content stored in the database has been updated with the new domain! I’ve had good luck with the Velvet Blues Update URLs plugin but you … Read more
You need to add a rewrite rule to WordPress. There are several options to do it depending on your exact needs. Maybe the most general is using add_rewrite_tag() and add_rewrite_rule(): add_action( ‘init’, ‘cyb_rewrite_rules’ ); function cyb_rewrite_rules() { add_rewrite_tag( ‘%variable1%’, ‘([^&]+)’ ); add_rewrite_tag( ‘%variable2%’, ‘([^&]+)’ ); add_rewrite_rule( ^system/([^/]*)/([^/]*)/?’, ‘index.php?pagename=$matches[1]&variable1=$matches[2]&variable2=$matches[3]’, ‘top’ ); } Now, if the URL … Read more
How about just define a constant that stores the plugin’s root path? Define path constant For calling numerous files, it is sometimes convenient to define a constant: define( ‘MY_PLUGIN_PATH’, plugin_dir_path( __FILE__ ) ); include( MY_PLUGIN_PATH . ‘includes/admin-page.php’); include( MY_PLUGIN_PATH . ‘includes/classes.php’); // etc. — See https://developer.wordpress.org/reference/functions/plugin_dir_path/#comment-491 So in your main plugin file: define( ‘MY_PLUGIN_PATH’, plugin_dir_path( … Read more
You need to reference your WordPress template directory when you register the script. Change this: wp_enqueue_script(‘my_javascript_file’, ‘/javascripts/app.js’, array(‘jquery’)); …to this: wp_enqueue_script(‘my_javascript_file’, get_template_directory_uri() . ‘/javascripts/app.js’, array(‘jquery’)); Codex reference: get_template_directory_uri()
You need to set the WP_HOME and WP_SITEURL in wp-config.php in a smarter way. Like this: <?php define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); // add the next line if you have a subdirectory install define(‘WP_SITEURL’, WP_HOME . ‘/path/to/wordpress’); This will solve your your issues with site URLs as they will be set dynamically on based on whatever … Read more
Using arbitrary paths in page urls