This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Attaching a PDF file in Contact Form 7 email notification | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/attach-pdf-file-in-cf7-email/ | |
*/ | |
add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' ); | |
function mycustom_wpcf7_mail_components( $components ) { | |
$components['attachments'][] = get_template_directory().'/pdf/test.pdf'; // PDF Path | |
return $components; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display a Read More link in WordPress Excerpts | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/display-read-link-wordpress-excerpts/ | |
*/ | |
function new_excerpt_more( $more ) { | |
return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'your-text-domain') . '</a>'; | |
} | |
add_filter( 'excerpt_more', 'new_excerpt_more' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to Move Comment Textarea to Bottom in WordPress | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/how-to-move-comment-textarea-to-bottom-in-wordpress/ | |
*/ | |
function wpb_move_comment_field_to_bottom( $fields ) { | |
$comment_field = $fields['comment']; | |
unset( $fields['comment'] ); | |
$fields['comment'] = $comment_field; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* How to create five equal columns in Bootstrap 3? | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/create-five-equal-columns-bootstrap-3/ | |
*/ | |
.col-xs-55, .col-sm-55, .col-md-55, .col-lg-55{ | |
position: relative; | |
min-height: 1px; | |
padding-right: 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function modifies the main WordPress query and includes an array of | |
* post types instead of the default 'post' and 'page' post type. | |
* | |
* @param object $query The original query. | |
* @return object $query The amended query. | |
*/ | |
function include_cpt_search( $query ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* Add Bootstrap Class to WooCommerce Checkout Fields | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/wc-checkout-bootstrap/ | |
*/ | |
add_filter('woocommerce_form_field_args', 'wc_form_field_args',10,3); | |
function wc_form_field_args($args, $key, $value) { | |
$args['input_class'] = array( 'form-control' ); | |
return $args; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* How to get various URL of all WooCommerce pages? | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/get-various-url-woocommerce-pages/ | |
*/ | |
// Get the Shop page url | |
echo get_permalink( wc_get_page_id( 'shop' ) ); | |
// Get the My Account page url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* How to save FTP details in WordPress website? | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/how-to-save-ftp-details-in-wordpress-website-quicktip/ | |
*/ | |
/** Setup FTP Details **/ | |
define("FTP_HOST", "localhost"); | |
define("FTP_USER", "your-ftp-username"); | |
define("FTP_PASS", "your-ftp-password"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* Secure FTP Connection in WordPress | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/how-to-save-ftp-details-in-wordpress-website-quicktip/ | |
*/ | |
// Secure Connection | |
define('FTP_SSL', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* Enable Direct FTP Access in WordPress | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/how-to-save-ftp-details-in-wordpress-website-quicktip/ | |
*/ | |
// Direct FTP Access | |
define('FS_METHOD', 'direct'); |
OlderNewer