Responsive Admin Themes

Is there a way to achieve this type of Left dashboard Admin menu without using a plugin? You have to put the code somewhere. That is either going to be a plugin, a must-use plugin, or a theme. A theme is a somewhat strange place to be putting code intended for the backend, so the … Read more

Loop that displays all posts by logged in user, with Post Edit link

$posts = get_posts( array( ‘post_author’ => get_current_user_id(), ‘post_status’ => ‘any’, ‘post_type’ => ‘any’, ) ); foreach ( $posts as $post ) printf( ‘<a href=”https://wordpress.stackexchange.com/questions/103977/%s”>%s</a><br />’, esc_attr( add_query_arg( ‘_ninja_forms_action’, ‘edit’, get_permalink( $post ) ) ), get_the_title( $post ) );

Change Woothemes admin url

While WP API probably would allow to move it quite cleanly (there are some plugins that shuffle pages around for different purposes) it is very hard to say if it will just work without complete audit of relevant code for how it uses the page, how it generates link to it and if it will … Read more

Correct way to make a title a link

Nice one for using WordPress, but this is a straight-up HTML question. Nontheless… <div class=”home-post-header”> <h2> <a href=”https://wordpress.stackexchange.com/questions/105657/<?php the_permalink() ?>”><?php the_title() ?></a> </h2> </div> h2‘s are considered block-level, whereas a & span are inline. Standards dictate that a block-level element cannot be nested inside an inline one. So use a div instead, & place the … Read more

Use WordPress Built In Jquery

The jQuery object is jQuery rather than $. See noConflict wrappers in wp_enqueue_script for some examples. jQuery(document).ready(function($) { // Inside of this function, $() will work as an alias for jQuery() // and other libraries also using $ will not be accessible under this shortcut });

Why we do need wp_enqueue_script() function?

According to the Codex: wp_enqueue_scripts() links a script file to the generated page at the right time according to the script dependencies, if the script has not been already included and if all the dependencies have been registered. You could either link a script with a handle previously registered using the wp_register_script() function, or provide … Read more

Put CSS on TOP, how?

Would be interesting to see if you get the same YSlow message when checking your site without any plugins. Its a little difficult to be sure because of the minification of HTML/CSS on your site, but it seems some of the plugins are not inserting stylesheets in to the <head> part of your document, and … Read more

Add a class to a menu item depending on a body class

Use the nav_menu_css_class() filter. The following function will add the current-menu-item class to a page identified by it’s slug. You can Update the $cpt_name and $menu_item_id variables to reflect your setup. add_filter( ‘nav_menu_css_class’, ‘nav_parent_class’, 10, 2 ); function nav_parent_class( $classes, $item ) { $cpt_name=”team”; $menu_item_id = 127; // id of menu item to add current-menu-item … Read more

Login to comment: not just user and email

You can try to add this kind of functionality, but it is unlikely to always work. You can not force people to identify their real life ID on the internet. Even geographical detection based on IP address is problematic and easy to avoid using proxies. If you want people to willingly identify themselves on your … Read more

Getting Plugin directory and url

Use the plugin_dir_path() and plugin_dir_url() helper functions: if( ! defined( ‘MY_PLUGIN_PATH’ ) ) define( ‘MY_PLUGIN_PATH’, plugin_dir_path( __file__ ) . ‘admin/’ ); if( ! defined( ‘MY_PLUGIN_DIR’ ) ) define( ‘MY_PLUGIN_DIR’, plugin_dir_url( __file__ ) . ‘admin/’ ); You should be using more unique constant names – ADMIN_PATH is far too generic.