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 this code into theme functions.php file | |
if ( current_user_can('contributor') && !current_user_can('upload_files') ) { | |
add_action('admin_init', 'allow_contributor_upload_image'); | |
function allow_contributor_upload_image() { | |
$contributor = get_role('contributor'); | |
$contributor->add_cap('upload_files'); | |
} |
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 this code to your theme functions.php | |
// add a favicon | |
function tt_new_favicon() { | |
echo '<link rel="favicon" type="image/x-icon" href="https://www.yoursite.com/wp-content/uploads/2022/09/favicon.ico" />'; | |
} | |
add_action('wp_head', 'tt_new_favicon'); |
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 this code into your theme functions.php file | |
add_filter('the_content', 'tt_featured_image_in_rss_feed'); | |
function tt_featured_image_in_rss_feed( $content ) { | |
global $post; | |
if( is_feed() ) { | |
if ( has_post_thumbnail( $post->ID ) ){ | |
$prepend = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 10px;' ) ) . '</div>'; |
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 this code into your theme functions.php file | |
function tt_change_excerpt_readmore_text( $more ){ | |
global $post; | |
return '… <a class="read-more" href="'.get_permalink($post->ID).'" title="'.esc_attr(get_the_title($post->ID)).'">'.'Continue Reading »'.'</a>'; | |
} | |
add_filter('excerpt_more', 'tt_change_excerpt_readmore_text'); |
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 thsi code into your theme functions.php | |
//Enable shortcode in text widget | |
add_filter('widget_text', 'do_shortcode'); |
OlderNewer