// validate text to show
-
In my widget configuration “Yuzo Related Posts” > Text > Text to display I’ve chosen “Excerpt from article”.
But what if the excerpt does not exist? I have a blog with several hundreds of posts. I cannot check every single post for the existence of a excerpt. And if I was able to check it (mysql shizzle) I don’t have the time to add an excerpt. On that case I would like to show the post content.therefor I applied the following change:
OPEN /wp-content/plugins/yuzo-related-post/assets/functions/widget.php FIND }elseif( isset($yuzo_option_widget->text_show) && $yuzo_option_widget->text_show == 2 ){ $text_to_show = $post->post_excerpt; } REPLACE WITH }elseif( isset($yuzo_option_widget->text_show) && $yuzo_option_widget->text_show == 2 ){ if ( $post->post_excerpt ) { $text_to_show = $post->post_excerpt; } else { $text_to_show = get_the_content(); } } SAVE&CLOSE
OPEN /wp-content/plugins/yuzo-related-post/assets/functions/widget.php FIND $text2_extract = '<span class="yuzo_text" style="font-size:'.((int)$yuzo_option_widget->font_size - 4).'px;" >'.$if_utils->IF_setHtml( $if_utils->IF_cut_text( $text_to_show , (int)$yuzo_option_widget->text2_length, TRUE ) ).'</span>'; REPLACE WITH $text2_extract = '<span class="yuzo_text">'.$if_utils->IF_setHtml( $if_utils->IF_cut_text( $text_to_show , (int)$yuzo_option_widget->text2_length, TRUE ) ).'</span>'; SAVE&CLOSE
It’s not up to you to define the font-size reduction of 4 px. That is up to the designer.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘// validate text to show’ is closed to new replies.