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
//Display short blog title in WordPress | |
//There is a simple script you can use to implement a short blog title without modifying the base WordPresscode. Open up your functions.php file within your theme and add the following: | |
function short_title() { | |
$title = get_the_title(); | |
$count = strlen($title); | |
if ($count >= 25) { | |
$title = substr($title, 0, 25); |
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
1/ Go to WP Repository and search for WP Smush | |
2/ Install WP Smush to Your WP Site | |
3/ Go to WP Smush plugin installation folder | |
4/ Go to “lib” folder | |
5/ Open file “class-wp-smush.php” for editing | |
6/ Search for “if ( empty( $api_key ) )” | |
7/ This function returns false, so change to 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 | |
if(ICL_LANGUAGE_CODE=='en'){ | |
echo 'content in english'; | |
} | |
if(ICL_LANGUAGE_CODE=='es'){ | |
echo 'content in spanish'; | |
} | |
?> |
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
/* | |
Quick Tip! What happens when your post title does not fit on one line? It wraps to the second line. What if it’s only one word? And what if that word is “it” or some other shorty? Your title won’t look too nice, eh? Here’s a solution, somewhere inside the loop: | |
*/ | |
$title = the_title( '<h2>', '</h2>', false ); | |
if ( strlen( $title ) > 0 ) | |
echo substr_replace( $title, ' ', strrpos( $title, ' ' ), 1 ); |
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
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') ); |
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 | |
/** | |
* Block template file: template-parts/blocks/sidebar/sidebar-headline.php | |
* | |
* Sidebar Headline Block Template. | |
* | |
* @param array $block The block settings and attributes. | |
* @param string $content The block inner HTML (empty). | |
* @param bool $is_preview True during AJAX preview. | |
* @param (int|string) $post_id The post ID this block is saved to. |
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
//******************************************************************************** | |
// Change text size of Gutenberg editor | |
// https://studiopress.blog/block-font-sizes/ | |
//******************************************************************************** | |
// Adds support for editor font sizes. | |
// Do NOT include the opening php tag. | |
add_theme_support( 'editor-font-sizes', array( | |
array( |
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 if(get_field('new_acf_text_area')){ | |
echo '<div>'. get_field('new_acf_text_area') .'</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 | |
global $wp_query; | |
$postid = $wp_query->post->ID; | |
echo get_post_meta($postid, 'Your-Custom-Field', true); | |
wp_reset_query(); |