Admin Notices coding standard issue

One way you can handle this would be to do the wp_sprintf when assigning the value of the $message variable and then use wp_kses when you want to output. You could also output the div and paragraph tags before and after the message, which would eliminate the need for wp_sprintf in this instance. add_action( ‘admin_notices’, … Read more

Can I run custom php on specific pages in wordpress?

If you are using a child or custom theme, I encourage you to look at the Codex’s Template Hierarchy. The short answer to your question is yes, you can run custom code on any page you’d like. The longer answer is still yes, but it’s a bit more involved in what your end product is … Read more

Notice: Undefined property: wpdb::$current_post What can be wrong?

There are problems with this part: ++$GLOBALS[‘wpdb’]->current_post There’s no current_post property of the wpdb class, here you’re most likely confusing the wpdb class with the WP_Query class. Also we wouldn’t want in general to modify the current_post property of the global WP_Query, it could surely “bite us” if we mess with the globals 😉 Note … Read more

Pinterest Integration Using functions.php

There were several errors in your code. The biggest was that the function didn’t even have a closing bracket, but we can probably assume that was just not copied into your post, otherwise nothing would have been working for you. This is a filter on the content right? It looks like you want to append … Read more

Open posts in editor in the ‘Text’ mode by default

Add the following line to your theme’s functions.php: add_filter( ‘wp_default_editor’, create_function( ”, ‘return “html”;’ ) ); Use “html” to set the Text editor tab as default (as shown above), or “tinymce” to set the Visual editor tab as default.

I want to remove the links from the term list returned by get_the_term_list

You could use get_the_terms() and wp_sprintf_l(): function wpse_52878_term_list( $args = array() ) { $default = array ( ‘id’ => get_the_ID(), ‘taxonomy’ => ‘post_tag’, ‘before’ => ”, ‘after’ => ”, ); $options = array_merge( $default, $args ); $terms = get_the_terms( $options[‘id’], $options[‘taxonomy’] ); $list = array(); foreach ( $terms as $term ) { $list[] = $term->name; … Read more

How to link to a alternative page in CSS

Two options. The first would be as you said to determine the browser size using javascript. Then have your code do something where it changes the link if the browser us either above or below a certain size. The second, and this may be your preferred method, would be to use css. If your theme … Read more

Formatting ?

You either need to add such code via the HTML editor (and not switch back to the Visual editor), or else you will need to pass a custom configuration to the Visual editor. I have similar needs, and here’s what I use (in functions.php): // http://tinymce.moxiecode.com/wiki.php/Configuration function cbnet_tinymce_config( $init ) { // Change code cleanup/content … Read more