Archive for the ‘Wordpress’ Category

How to make WP Page Navi work in custom loop WP_query

Thursday, January 26th, 2012

Problem:  Wp page navi doesnt work in custom loop in a page . Software: WordPress WP Page Navi Function: get_posts, query_posts , WP_Query, wp_pagenavi, get_query_var Solutions: 1. Add the custom $query to the wp page navi function: if(function_exists(‘wp_pagenavi’)) wp_pagenavi(array( ‘query’ =>$query )); 2. Add the value of page in your WP_query. $paged = get_query_var(‘paged’) ? [...]

>>read more

Watermarks are gone after the contact form 7 submit

Tuesday, January 10th, 2012

Problem: How to display the watermark again after the forms submitted in contact Form 7 . Software: Contact form 7 WordPress 3.3.1 Solustion : Add the code below inside the $.fn.wpcf7ClearResponseOutput = function() { in scripts.js in contact form plugin folder. $(this).find(‘.wpcf7-use-title-as-watermark’).each(function(i, n) { var input = $(n); input.val(input.attr(‘title’)); input.addClass(‘watermark’); }); If you are using [...]

>>read more

How to popup the thank you message in contact form 7 in wordpress thickbox

Tuesday, January 10th, 2012

Problem:   I want the thank you message popup in the contact form 7  plugin using thickbox instead of sliding. Software: WordPress 3.3.1 Thickbox Contact Form 7 Solution: 1. Install Auto Thickbox Plus Plugin 2. Edit Scripts.js in your contact form 7 plugin Look and comment : //    ro.addClass(‘wpcf7-mail-sent-ok’); And add after that line: var url [...]

>>read more

How to make different single post template in each category

Tuesday, January 10th, 2012

Problem:  How to display single post in different template or layout  under a specific category. Not like in page that you can specify the page template ( custom page template). Software: WordPress 3.3.1 Solution: 1. Create a different single post template like: single_default.php single_category1.php single_category2.php 2. Edit your single.php <?php $post = $wp_query->post; wp_reset_query(); $cat [...]

>>read more

Prevent auto skype graphic formating plugin to all phone numbers

Tuesday, January 10th, 2012

Problem: Skype plugin in browser such as Chrome and Firefox auto convert or overwriting phone number in a page. Solutions 1: Use a special character : (570)­ &shy; 555-1234 Solutions 2: Use inline CSS3 : (570)­<span style=”display:none”>&nbsp;</span> 555-1234 Solutions 3: Use WordPress Plugin : Prevent Skype Overwriting

>>read more

How to display all the attached images of the postsWordPress

Monday, January 2nd, 2012

Problem: How to display all the images you uploaded in the post without putting a shortcodes “[ gallery ]” in the WYSWYG Editor. Software: WordPress 3.3 Solution: 1. Edit your single.php  and add the code anywhere on the loop: <?php echo do_shortcode(‘[ gallery ]‘); ?> Note : “[ gallery ]” has no space. I had [...]

>>read more

How to redirect all 404 page, not found page dead links to your homepage wordpress

Friday, November 25th, 2011

Issue: How to redirect all the dead links to your homepage in wordpress. Solutions: 1. Add 404.php in your current template 2. Add the code below: <?php header(“Status: 301 Moved Permanently”); header(“Location:http://www.yoursite.com”); ?> Change yoursite.com with your domain.

>>read more

Add onblur , onfocus attribute in contact form 7 text field

Tuesday, November 22nd, 2011

Problem: How to add onblur and onfocus attribute to contact form 7  wordpress plugin text field. Solutions: Add the below code  to line 70 of modules/text.php if ( $value != ” ) { $atts .= ‘ onfocus=”if (this.value == \” . esc_attr( $value ) . ‘\’) {this.value = \’\';}” onblur=”if (this.value == \’\') {this.value = [...]

>>read more

How to get category name and category id in product page loop jigoshop wordpress

Tuesday, October 25th, 2011

Issue:  How to get category name and id with in the loop of  jigoshop wordpress plugin. Solutions: Add this inside the loop: Category with link: $cat_name= $_product->get_categories( ‘, ‘, ”, ”); $str=$cat_name; echo $str; Category without link: $cat_name= $_product->get_categories( ‘, ‘, ”, ”); $str=$cat_name; preg_match_all(“!<a [^>]+>(.*?)</a>!”, $str, $matches); $cat_name =$matches[1][0]; echo $cat_name; To get category [...]

>>read more

How to put additional custom field in jigoshop add product page

Tuesday, October 18th, 2011

Issue:  My client wants a additional field in jigoshop add product page. Solutions : 1. Edit jigoshop/jigoshop_taxonomy.php 2. Look for ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘comments’/*, ‘page-attributes’*/ ), change to : ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘comments’,’custom-fields’ /*, ‘page-attributes’*/ ),

>>read more