Wordpress 3
Get Category Slug on Single Product Page
In wpsc_single-product.php: //get cat of product $query_data = Array(); $pr_post_id = wpsc_the_product_id(); $categories = wp_get_object_terms($pr_post_id , ‘wpsc_product_category’ ); //if product is associated with more than one category if(count($categories) > 1 && isset($wpsc_query->query_vars[‘wpsc_product_category’])) $query_data[‘category’] = $wpsc_query->query_vars[‘wpsc_product_category’]; elseif(count($categories) > 0) $query_data[‘category’] = $categories[0]->slug; Then you can use the category slug as follows for example: if($query_data[‘category’] == “t-shirts”){…
Read MoreGet Link to Featured Image for use in View
In functions.php create function and shortcode /** *************************************************** * get image src for featured image of post (large version) */ /* Register our short code at the appropriate time during the WordPress Boot process. */ add_action( ‘init’, ‘wpk_register_shortcodes’); function wpk_register_shortcodes(){ add_shortcode(‘my_get_thumbsrc’, ‘my_get_thumbsrc’); } /* Function to return the source url for the featured image of…
Read MoreWP Ecommerce variation out of stock message
When a variation is out of stock WP Ecommerce defaults to saying that the product is out of stock rather than just the variation. There is fork on Git hub covering this at: https://github.com/wp-e-commerce/WP-e-Commerce/pull/495 The fix is as follows: wp-content/plugins/wp-e-commerce/wpsc-includes/ajax.functions.php Around line 100 change as follows: – $cart_messages[] = sprintf( __( ‘Sorry, but the item…
Read MoreUpdate Text Using PO Files. Translate Text.
A basic guide to translating wp-e-commerce using poEdit 1. Download and Install poEdit : http://www.poedit.net/download.php 2. Run poEdit and open a translation file (.po) from the `wp-e-commerce/languages` folder 3. Go through the list of words / sentences and add in your translations 4. In poEdit make sure you have the box checked in Preferences>Editor ‘Automatically…
Read MoreChange Ticket Table Headings on Event Page
To customize the headings on the ticket list on the single events page use this in your theme functions file: function my_custom_ticket_header($columns){ $columns = array( ‘type’ => __(‘Ticket’,’dbem’), ‘price’ => __(‘Price ex.GST’,’dbem’), ‘spaces’ => __(‘Places’,’dbem’)); return $columns; } add_filter(’em_booking_form_tickets_cols’,’my_custom_ticket_header’,1,1);
Read MoreOverride ie.css in TwentyTwelve for Child Theme
TwentyTwelve loads ie.css from functions.php so to override it in your child theme use the following in your themes functions.php // remove ie css from twentytwelve theme function mytheme_dequeue_styles() { wp_dequeue_style( ‘twentytwelve-ie’ ); } add_action( ‘wp_enqueue_scripts’, ‘mytheme_dequeue_styles’, 11 ); //add new from child theme wp_enqueue_style( ‘mytheme-ie’, get_stylesheet_directory_uri() . ‘/css/ie.css’, array( ‘twentytwelve-style’ ), ‘1.0’ ); $wp_styles->add_data(…
Read MoreShow Recent Posts in Template
In template: Default $args Usage: Recent Posts
Read MoreNextGen Gallery Image Object
The following is a print out of the $image object used in galleries: Note: [*caption] * added because ‘caption’ seems to be a reserved word nggImage Object ( [errmsg] => [error] => [imageURL] => http://yoursite.com/wp-content/gallery/logos/wd-logo.jpg [thumbURL] => http://yoursite.com/wp-content/gallery/logos/thumbs/thumbs_wd-logo.jpg [imagePath] => /home/username/public_html/wp-content/gallery/logos/wd-logo.jpg [thumbPath] => /home/username/public_html/wp-content/gallery/logos/thumbs/thumbs_wd-logo.jpg [href] => [thumbPrefix] => thumbs_ [thumbFolder] => /thumbs/ [galleryid] => 7…
Read MoreContact Form 7 Stop Email Being Sent
To prevent the form sending its email use this in themes functions.php within a function: (might no longer work with WP3.5) // stop email being sent $wpcf7->skip_mail = 1; or put this in the additional settings field of the form demo_mode: on
Read MoreContact Form 7 Change Action URL
To send form output to a different file put this in themes functions.php. This code also limits this change to page 434 and adds the $wpcf7->skip_mail function to stop the form sending an email. //change action url of contact form add_filter(‘wpcf7_form_action_url’, ‘wpcf7_custom_form_action_url’); function wpcf7_custom_form_action_url($url) { global $post, $wpcf7; if ($post->ID === 434) { //its the…
Read More