Don’t display a sidebar widget when on a specific page

Assuming that the ‘blog’ slug is correct, your code would work. I would suggest making a separate template for the page, namely page-blog.php (see http://codex.wordpress.org/images/1/18/Template_Hierarchy.png and http://codex.wordpress.org/Template_Hierarchy) where you set up the structure and appearance of the page exactly as you want it to be. WordPress will automatically look for the file when opening a … Read more

quotes problem in very simple sql

if you’re communicating with the WordPress database itself, try using $wpdb->prepare() on your select string before running it as $wpdb->query() – it should format it for you. Further reading: Codex

How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?

function dpsc_pnj_send_mail($to, $from, $name, $subject, $msg, $attachment = FALSE) { global $wpdb; $headers=”MIME-Version: 1.0″ . “\r\n”; $headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”; $headers .= ‘From: ‘ . $name . ‘ ‘ . $from . ” . “\r\n”; if ($attachment) { if ($dp_shopping_cart_settings[‘dp_shop_pdf_generation’] === ‘checked’) { $mail_attachment = array(DP_PLUGIN_DIR. ‘/pdf/invoice_’ . $attachment . ‘.pdf’); @wp_mail($to, … Read more

Hard-coding a shortcode as the last menu item in primary navigation?

add_filter(‘wp_nav_menu_items’,’my_item’, 10, 2); function my_item($items, $args) { $items .= ‘<li class=”myclass”>whatever</li>’; return $items; } If you have a specific theme location for menu you can target it with : if( $args->theme_location == ‘mylocation’ ) EDIT I you can try $items .= ‘<li class=”myclass”>’ . echo do_shortcode(‘[shopping_cart]’) . ‘</li>’; but it will work only if the … Read more

the_post(); prints out style text into my HTML?

You can view the actions and filters being used in your plugins and themes. I’m assuming something is hooked into the_post action somewhere. Dumping the following globals give you a peek behind the curtain here. global $wp_actions, $wp_filters; Once you identify the source, you either queue up the CSS properly in the HEAD, or remove … Read more

Use of antispambot with $curauth->email

As the Codex states for the antispambot() function: Return Values (string) Converted email address. You have to do one of the following: echo antispambot( $curauth->publicemail ); // OR… print antispambot( $curauth->publicemail ); So your full example would look like the following: if ( ! empty( $curauth->publicemail ) ) { echo ‘Email <a href=”https://wordpress.stackexchange.com/questions/43732/mailto:”.antispambot( $curauth->publicemail ).’?subject=Webmail”> … Read more

Functions.php and includes

Many theme frameworks and complex themes break up functions into different files and include them in one file called functions.php, sometimes within a folder called inc. If it’s your own theme, you can pretty much do what you want. If it’s a theme to be released, end users typically look for a functions.php file as … Read more

Pagination Not Working (pages duplicating content)

This is because query_posts resets the query. See this warning on the Codex page: Pagination won’t work correctly, unless you use query_posts() in a page template and you set the ‘paged’ query var appropriately: http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html The call: query_posts( ‘category_name=category&showposts=2′); does not tell it which page to get (so it gets the first page). It’s a … Read more