Message on Custom Posts Type admin page

Good question. I’ve often wondered it myself. This will work. You just need to change my_post_type_slug to the slug of your post type. There might be a cleaner way to find the post type other than using $_GET but it’s good enough for now! add_action(‘all_admin_notices’, ‘my_admin_notices’); function my_admin_notices() { if ($_GET[‘post_type’] == ‘my_post_type_slug’ ) { … Read more

How to add nofollow to wp_nav_menu

As you can see above, the Advanced Menu Properties are hidden under the Screen Options pull down tab located in the upper-right corner of WordPress Dashboard. NOTE: Make sure that you are in the Menus screen: http://yoursite.com/wp-admin/nav-menus.php W.r.t your question, the Link Relationship (XFN) option is what you want “check”. Then the appropriate field will … Read more

What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]

The first is a pattern called a closure. It’s not unique to jQuery. You could just as easily write (function(someVar) { // Inside the closure, someVar == “test” })(“test”); Basically, you’re manually passing jQuery into the closure by referencing the jQuery object externally and aliasing it to $ inside the context of the closure. The … Read more

WP_LOCALIZE_SCRIPT doesn’t work

You have to use the correct handle: wp_localize_script(‘page_data’, ‘glr_dt’, $gallery_js_data_array); // Edit Your code is also wrong. What do you want to do in this line: ‘maxPages’ => ‘$gallery_max_load = $gallery->max_num_pages;’ You are assigning a string to maxPages. I guess you want it that way (or similar): ‘maxPages’ => $gallery->max_num_pages, Now, you can access the … Read more