Category Archives: Plugins

Hard Code Squelch Tabs

Hard code the Squelch tabs in a template so you can use scripts inside the tabs.

Install Squelch Tabs and Accordians.

Then in template:

 HTML |  copy code |? 
01
<div id="squelch-taas-tab-group-0" class="squelch-taas-tab-group squelch-taas-override" data-title="" data-disabled="false" data-collapsible="false" data-active="0" data-event="click">
02
    <ul>
03
        <li class="squelch-taas-tab"><a href="#squelch-taas-tab-content-0-0">Title 0</a></li>
04
        <li class="squelch-taas-tab"><a href="#squelch-taas-tab-content-0-1">Title 1</a></li>
05
        <li class="squelch-taas-tab"><a href="#squelch-taas-tab-content-0-2">Title 2</a></li>
06
        <li class="squelch-taas-tab"><a href="#squelch-taas-tab-content-0-3">Title 3</a></li>
07
    </ul>
08
    <div id="squelch-taas-tab-content-0-0">
09
        Content 0
10
    </div><!-- tab-content-0-0 -->
11
    <div id="squelch-taas-tab-content-0-1">
12
        Content 1
13
    </div><!-- tab-content-0-1 -->
14
    <div id="squelch-taas-tab-content-0-2">
15
        Content 2
16
    </div><!-- tab-content-0-2 -->
17
    <div id="squelch-taas-tab-content-0-3">
18
        Content 3
19
    </div><!-- tab-content-0-3 -->
20
</div><!-- tab group -->

Posted in Squelch Tabs and Accordians, Theming | Leave a comment

WP Ecommerce Shop Styling Purchase Table in Email Template

Using the WP Ecommerce Shop Styling plugin.

Email template product table is improved by adding the following styling to the email template:

 CSS |  copy code |? 
1
#products-table { width: 100%;}
2
#products-table td {padding:5px;}
3
#products-table th{text-align: left;}

Posted in CSS, WP Ecommerce | Leave a comment

Update 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 Save .mo file on save’
5. Save your translation file in the `wp-e-commerce/languages` folder give it a descriptive name ie: wpsc-en_US means english – american, wpsc-fr_FR means french – france (note: your filename must have ‘wpsc-’ at the start to work)
6. In your wordpress wp-config.php file edit the line that looks like this:
`define (‘WPLANG’, ”);`
with the file name (without extension) inside the second set of quotation marks.
i.e If I saved my mo file as `wpsc-en_BG.mo` then I would change the WPLANG line to:
`define (‘WPLANG’, ‘en_BG’);`
7. Save your wp-config.php
8. Refresh your website in a web browser, your new translations should now be viewable on your site.

References
http://codex.wordpress.org/WordPress_in_Your_Language
http://codex.wordpress.org/I18n_for_WordPress_Developers
http://www.forumone.com/blogs/post/translating-your-wordpress-site-using-pot-file

Posted in Tips and Tricks, Wordpress 3, WP Ecommerce | Leave a comment

Change 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:

 PHP |  copy code |? 
1
function my_custom_ticket_header($columns){
2
 $columns = array( 'type' => __('Ticket','dbem'), 'price' => __('Price ex.GST','dbem'), 'spaces' => __('Places','dbem'));
3
 return $columns;
4
}
5
add_filter('em_booking_form_tickets_cols','my_custom_ticket_header',1,1);

Posted in Events Manager, Plugins, Wordpress 3 | Leave a comment

NextGen 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

 HTML |  copy code |? 
01
nggImage Object ( 
02
[errmsg] => 
03
[error] => 
04
[imageURL] => http://yoursite.com/wp-content/gallery/logos/wd-logo.jpg 
05
[thumbURL] => http://yoursite.com/wp-content/gallery/logos/thumbs/thumbs_wd-logo.jpg 
06
[imagePath] => /home/username/public_html/wp-content/gallery/logos/wd-logo.jpg 
07
[thumbPath] => /home/username/public_html/wp-content/gallery/logos/thumbs/thumbs_wd-logo.jpg 
08
[href] => 
09
[thumbPrefix] => thumbs_ 
10
[thumbFolder] => /thumbs/ 
11
[galleryid] => 7 
12
[pid] => 101 
13
[filename] => wd-logo.jpg 
14
[description] => 
15
[alttext] => letter head 1 
16
[imagedate] => 2013-02-13 01:09:14 
17
[exclude] => 0 
18
[thumbcode] => 
19
[name] => logos 
20
[path] => wp-content/gallery/logos
21
[title] =>Logos
22
[pageid] => 0 
23
[previewpic] => 101 
24
[permalink] => 
25
[image_slug] => wd-logo 
26
[post_id] => 0 
27
[sortorder] => 0 
28
[meta_data] =>  Array ( 
29
    [0] => 
30
    [aperture] => 
31
    [credit] => 
32
    [camera] => 
33
    [*caption] => 
34
    [created_timestamp] =>  
35
    [copyright] => 
36
    [focal_length] => 
37
    [iso] => 
38
    [shutter_speed] => 
39
    [flash] => 
40
    [title] => letter head 1 
41
    [keywords] => 
42
    [width] => 800 
43
    [height] => 244 
44
    [saved] => 1 
45
    [thumbnail] => Array( 
46
        [width] => 150 
47
        [height] => 150 
48
    ) 
49
) 
50
[gid] => 7 
51
[slug] => logos 
52
[galdesc] => 
53
[author] => 1 
54
[imageHTML] =>
55
[hidden] => 
56
[style] => 
57
[pidlink] => /directory/?pid=101 
58
[url] => http://yoursite.com/wp-content/gallery/logos/wd-logo.jpg 
59
[thumbnailURL] => http://yoursite.com/wp-content/gallery/logos/thumbs/thumbs_wd-logo.jpg 
60
[size] => width="150" height="150" 
61
 =>   
62
[ngg_custom_fields] => Array ( ) ) 
63

Posted in NextGen Gallery, Plugins, Wordpress 3 | 1 Comment

Contact 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)

 PHP |  copy code |? 
1
// stop email being sent
2
 $wpcf7->skip_mail = 1;

or put this in the additional settings field of the form

 PHP |  copy code |? 
1
demo_mode: on

Posted in Contact Form 7, Plugins, Wordpress 3 | Leave a comment

Contact 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.

 PHP |  copy code |? 
01
//change action url of paystation form
02
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
03
function wpcf7_custom_form_action_url($url)
04
{
05
    global $post;
06
     if ($post->ID === 434) {
07
         //its the payments page
08
        return '/wp-content/themes/mytheme/refresh.php';
09
        // stop email being sent
10
       $wpcf7->skip_mail = 1;
11
    } else {
12
        return $url;
13
    }
14
 }

Form data is POSTed to refresh.php but the form ajax will keep the initial page loaded.

To redirect to the second file you can disable the Contact Form 7 scripts as described here

This removes validation but this can be added using a custom script as described here

Posted in Contact Form 7, Wordpress 3 | Leave a comment

Load Contact Form 7 JS Scripts Only When Needed

Contact Form 7 loads its scripts on all pages which uses memory and increases load time.

Add this to functions.php to only load scripts when required:

 PHP |  copy code |? 
1
// only load js scripts for wpcf7 on contact and join pages
2
// Add the Contact Form 7 scripts on selected pages
3
 
4
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
5
function my_deregister_javascript() {
6
if ( !is_page(array(42,35)) ) {
7
wp_deregister_script( 'contact-form-7' );
8
}
9
}

Posted in Contact Form 7, Plugins, Tips and Tricks, Wordpress 3 | Leave a comment

Contact Form 7 -Country Drop Down List

This short code gives a dropdown list of countries for Contact Form 7:

 HTML |  copy code |? 
1
[select country  "-----" "Afghanistan" "Albania" "Algeria" "American Samoa" "Andorra" "Angola" "Anguilla" "Antigua and Barbuda" "Argentina" "Armenia" "Armenia" "Aruba" "Australia" "Austria" "Azerbaijan" "Azerbaijan" "Bahamas" "Bahrain" "Bangladesh" "Barbados" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia" "Bonaire" "Bosnia and Herzegovina" "Botswana" "Bouvet Island (Bouvetoya)" "Brazil" "British Indian Ocean Territory (Chagos Archipelago)" "British Virgin Islands" "Brunei Darussalam" "Bulgaria" "Burkina Faso" "Burundi" "Canada" "Cambodia" "Cameroon" "Cape Verde" "Cayman Islands" "Central African Republic" "Chad" "Chile" "China" "Christmas Island" "Cocos (Keeling) Islands" "Colombia" "Comoros" "Congo" "Congo" "Cook Islands" "Costa Rica" "Cote d'Ivoire" "Croatia" "Cuba" "Curaçao" "Cyprus" "Cyprus" "Czech Republic" "Denmark" "Djibouti" "Dominica" "Dominican Republic" "Ecuador" "Egypt" "El Salvador" "Equatorial Guinea" "Eritrea" "Estonia" "Ethiopia" "Falkland Islands (Malvinas)" "Faroe Islands" "Fiji" "Finland" "France" "French Guiana" "French Polynesia" "French Southern Territories" "Gabon" "Gambia" "Georgia" "Georgia" "Germany" "Ghana" "Gibraltar" "Greece" "Greenland" "Grenada" "Guadeloupe" "Guam" "Guatemala" "Guernsey" "Guinea" "Guinea-Bissau" "Guyana" "Haiti" "Heard Island and McDonald Islands" "Holy See (Vatican City State)" "Honduras" "Hong Kong" "Hungary" "Iceland" "India" "Indonesia" "Iran" "Iraq" "Ireland" "Isle of Man" "Israel" "Italy" "Jamaica" "Japan" "Jersey" "Jordan" "Kazakhstan" "Kazakhstan" "Kenya" "Kiribati" "Korea" "Korea" "Kuwait" "Kyrgyz Republic" "Lao People's Democratic Republic" "Latvia" "Lebanon" "Lesotho" "Liberia" "Libyan Arab Jamahiriya" "Liechtenstein" "Lithuania" "Luxembourg" "Macao" "Macedonia" "Madagascar" "Malawi" "Malaysia" "Maldives" "Mali" "Malta" "Marshall Islands" "Martinique" "Mauritania" "Mauritius" "Mayotte" "Mexico" "Micronesia" "Moldova" "Monaco" "Mongolia" "Montenegro" "Montserrat" "Morocco" "Mozambique" "Myanmar" "Namibia" "Nauru" "Nepal" "Netherlands" "Netherlands Antilles" "New Caledonia" "New Zealand" "Nicaragua" "Niger" "Nigeria" "Niue" "Norfolk Island" "Northern Mariana Islands" "Norway" "Oman" "Pakistan" "Palau" "Palestinian Territory" "Panama" "Papua New Guinea" "Paraguay" "Peru" "Philippines" "Pitcairn Islands" "Poland" "Portugal" "Puerto Rico" "Qatar" "Reunion" "Romania" "Russian Federation" "Rwanda" "Saint Barthelemy" "Saint Helena" "Saint Kitts and Nevis" "Saint Lucia" "Saint Martin" "Saint Pierre and Miquelon" "Saint Vincent and the Grenadines" "Samoa" "San Marino" "Sao Tome and Principe" "Saudi Arabia" "Senegal" "Serbia" "Seychelles" "Sierra Leone" "Singapore" "Sint Maarten (Netherlands)" "Slovakia (Slovak Republic)" "Slovenia" "Solomon Islands" "Somalia" "South Africa" "South Georgia & S. Sandwich Islands" "Spain" "Sri Lanka" "Sudan" "Suriname" "Svalbard & Jan Mayen Islands" "Swaziland" "Sweden" "Switzerland" "Syrian Arab Republic" "Taiwan" "Tajikistan" "Tanzania" "Thailand" "Timor-Leste" "Togo" "Tokelau" "Tonga" "Trinidad and Tobago" "Tunisia" "Turkey" "Turkey" "Turkmenistan" "Turks and Caicos Islands" "Tuvalu" "U.S. Virgin Islands" "U.S. Minor Outlying Islands" "Uganda" "Ukraine" "United Arab Emirates" "United Kingdom" "United States" "Uruguay" "Uzbekistan" "Vanuatu" "Venezuela" "Vietnam" "Wallis and Futuna" "Western Sahara" "Yemen" "Zambia" "Zimbabwe"]
2

Original Source is here>>

Move items that you want to show in a short list at the top of the list to before the “_______” item

Posted in Contact Form 7 | Leave a comment

Wp Ecommerce Responsive CSS

Add the following CSS rules to make WP-Ecommerce plugin more responsive to mobile devices:

 CSS |  copy code |? 
01
#content .product_grid_display .item_image a {
02
   display: inline;
03
}
04
#primary #content #grid_view_products_page_container, #primary #content #grid_view_products_page_container, #primary #content #list_view_products_page_container {
05
  line-height: 1.2em;
06
  min-width: 300px;
07
  position: relative;
08
  width: 100%;
09
}
10
#default_products_page_container .imagecol img, #list_view_products_page_container img, #grid_view_products_page_container img {
11
   height: auto !important;
12
 }
13
#checkout_page_container {
14
  clear: both;
15
  position: relative;
16
  width: 100%;
17
}

Posted in WP Ecommerce | Leave a comment