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
<?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
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
//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
/* | |
Add to functions.php: | |
*/ | |
// Defines the length of the_excerpt | |
function my_excerpt_length($text){ | |
return 30; | |
} | |
add_filter('excerpt_length', 'my_excerpt_length'); |
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
/* | |
Theme Name: | |
Theme URI: http:// | |
Description: | |
Version: 1.0 | |
Author: | |
Author URI: http:// | |
Tags: | |
*/ |