Retrieve Path of admin.php
You can use admin_url() function for wp-admin.css file and ABSPATH for admin.php. $admin_php_path = ABSPATH . ‘/wp-admin/admin.php’; $admin_css_url = admin_url( ‘css/wp-admin.css’ );
You can use admin_url() function for wp-admin.css file and ABSPATH for admin.php. $admin_php_path = ABSPATH . ‘/wp-admin/admin.php’; $admin_css_url = admin_url( ‘css/wp-admin.css’ );
I’m not sure why are you trying to print out a PHP file’s path, because it’s not a good practice. But to get the equivalent function for themes, you can use: For parent themes : get_template_directory_uri(); For Child themes: get_stylesheet_uri(); Both are without trailing slash. Important Note Don’t ping a PHP file directly from your … Read more
get_stylesheet_directory_uri() is a PHP function, you must use it in a PHP file instead of your CSS file. In your functions.php you can paste this code and change depends on your needs: function my_login_logo() { ?> <style type=”text/css”> body.login div#login h1 a { background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/Logo-B-Classic.jpg); } </style> <?php } add_action( ‘login_enqueue_scripts’, ‘my_login_logo’ … Read more
you can use this plugin to generate this kind of permalink https://wordpress.org/plugins/wp-category-permalink/
Use the upload_dir filter. add_filter( ‘upload_dir’, ‘wpse_261931_upload_dir’, 10, 1 ); function wpse_261931_upload_dir( array $uploads ) { if( is_multisite() ) { //* Do something interesting with the $uploads directory } return $uploads; }
The post format taxonomy: The post format is a default taxonomy, registered with: register_taxonomy( ‘post_format’, ‘post’, array( ‘public’ => true, ‘hierarchical’ => false, ‘labels’ => array( ‘name’ => _x( ‘Format’, ‘post format’ ), ‘singular_name’ => _x( ‘Format’, ‘post format’ ), ), ‘query_var’ => true, ‘rewrite’ => $rewrite[‘post_format’], ‘show_ui’ => false, ‘_builtin’ => true, ‘show_in_nav_menus’ => … Read more
insert.php file that I made myself, actually I am new to wordpress, I want to that is there any mistake that i am making? Actually I want to store a plugin form information in the database. Your question is very light on detail but I suspect that the mistake you are making is loading a … Read more
Use wp_localize_script() to pass any kind of data to your loaded scripts, in this case we need plugins_url(): wp_enqueue_script(‘my-script’, get_stylesheet_directory_uri() . ‘/js/my-script.js’); wp_localize_script(‘my-script’, ‘myScript’, array( ‘pluginsUrl’ => plugins_url(), )); Now you will have access to myScript.pluginsUrl in your script file: var href = myScript.pluginsUrl + ‘/path/to/resource’;
How to get WordPress to save upload file beyond web root [closed]
Always use the built-in versions. Don’t waste time with old WordPress installations – other plugins will break there too. See wp-includes/script-loader.php for the list of available files. Quite a lot. 🙂 And avoid remote resources. Some (Google) fail to send the scripts gzip compressed to all supporting browsers, others may not be reliable enough. There … Read more