Get current logged in user under 3.1, re: remove “Howdy”

Why fiddle around with jQuery when you could just run a filter on gettext to specifically target that text? Perhaps you simply don’t know you can do that, so here’s how.. add_filter( ‘gettext’, ‘change_howdy_text’, 10, 2 ); function change_howdy_text( $translation, $original ) { if( ‘Howdy, %1$s’ == $original ) $translation = ‘Logged in as %1$s’; … Read more

Jquery conflict

At least one issue I can see is that you’re including the jQuery framework at least twice. The first line <?php wp_enqueue_script(“jquery”); ?> Is the preferred method of including jQuery. Your installation of WordPress happens to include jQuery version 1.4.2. This allows good plugin and theme developers to leverage jQuery and not accidentally include it … Read more

jQuery breaking my wordpress site

You should not include jQuery manually. jQuery is included in WordPress by default, but isn’t loaded on every page unless a plugin or theme requests it. This can be done using: add_action(‘wp_enqueue_scripts’,’my_scripts’); function my_scripts() { wp_enqueue_script(‘jquery’); } Here is function reference for wp_enqueue_script (the function) and wp_enqueue_scripts (the action hook). In addition to that, WordPress … Read more

Showing Author Information and Latest Post by author in lightbox when clicked on the name of the author

You will want to implement that using AJAX. Read these two articles from the Codex for further information about integrating WordPress with some AJAX action: AJAX AJAX in Plugins Just to give you a head start, you will want something like this: Client-side (Javascript) $(element).click(function() { var data = { action: ‘get_author_info’, author_id: your-author-id }; … Read more

Using wp_localize_script to store the template url into a variable to use in JS

You are not enqueueing your custom JavaScript file. And calling the var (templateUrl) in JS file without the handle. Follow the following: I’m enqueueing my custom JavaScripts file (script.js) under the dependency of jQuery, so it will enqueue jQuery library from core. And I’m using the same handle my-custom-js for both my script and localize_script … Read more

different template for first and second level custom post page

i needed something similar and i’ve come up with this simple little function that make things easier : function is_child_post($parent_ID = null) { global $post; if (isset($parent_ID) && $parent_ID != null){ return $post->post_parent == $parent_ID; } return $post->post_parent > 0; } Usage: check if a post/page/custom has a parent: if (is_child_post()){ //yes we have a … Read more