This file contains hidden or 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 | |
// Source: https://github.com/elementor/elementor/issues/3863#issuecomment-643794411 | |
// Previous next post thumb | |
add_filter('previous_post_link', 'sydney_child_post_nav_thumbnail', 20, 5 ); | |
add_filter('next_post_link', 'sydney_child_post_nav_thumbnail', 20, 5 ); | |
function sydney_child_post_nav_thumbnail($output, $format, $link, $post, $adjacent) { | |
if( !$output ) { |
This file contains hidden or 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
/** | |
* Source: https://fluentforms.com/docs/limit-email-domains-in-fluent-forms-form-submission/ | |
**/ | |
add_filter('fluentform_validate_input_item_input_email', function ($error, $field, $formData, $fields, $form) { | |
/* | |
* add your accepted domains here | |
* Other domains will be failed to submit the form | |
*/ |
This file contains hidden or 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
/** | |
* Force the feature image to occupy post image space in Cards layout | |
* Choose 1 of the solutions below which suits your scenario | |
**/ | |
/* if the elementor-fit-height class exists */ | |
.elementor-post__thumbnail.elementor-fit-height img { | |
height: 100% !important; | |
width: auto !important; | |
} |
This file contains hidden or 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 a custom class to the body for password posts / pages only | |
function add_password_protected_body_class( $classes ) { | |
if ( post_password_required() ) | |
$classes[] = 'wp-password-page'; | |
return $classes; | |
} | |
add_filter( 'body_class', 'add_password_protected_body_class' ); |
This file contains hidden or 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
function custom_meta_box_fields( $meta_fields ) { | |
$meta_fields[__( 'Additional Information', 'wpsl' )] = array( | |
'phone' => array( | |
'label' => __( 'Tel', 'wpsl' ) | |
), | |
'fax' => array( | |
'label' => __( 'Fax', 'wpsl' ) | |
), | |
'email' => array( |
This file contains hidden or 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 | |
/* | |
* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen | |
*/ | |
function rd_duplicate_page_as_draft(){ | |
global $wpdb; | |
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_page_as_draft' == $_REQUEST['action'] ) ) ) { | |
wp_die('No post to duplicate has been supplied!'); | |
} |
This file contains hidden or 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 | |
/* | |
* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen | |
*/ | |
function rd_duplicate_post_as_draft(){ | |
global $wpdb; | |
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { | |
wp_die('No post to duplicate has been supplied!'); | |
} |