How to view in expert field box in WP-admin side?

Just below one line code is working very perfectly.

add_post_type_support(‘page’, ‘excerpt’);

this is very fun. But this working.

How to change expert more link label in WP?

// This link in excerpts more
function new_excerpt_more($more) {
global $post;
return ‘<a href=”‘. get_permalink($post->ID) . ‘”>Read More</a>’;
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);

Add above code in your functions.php.(This is file contain in your theme inside.)

What label you need, change the return href inside.

How to Change the Expert Length in WP?

Just add below code in functions.php inside,

add_filter(‘excerpt_length’, ‘my_excerpt_length’);
function my_excerpt_length($length) {
return 25;
}

And change the return value “25” to “Your Value”.

How to reduce expert length in WP?

This is reduce all Expert length in your word press :
add_filter(‘excerpt_length’, ‘my_excerpt_length’);
function my_excerpt_length($length) {
return 22;
}

This is reduce your categorie wise Expert length in your word press :
I getting below code for reference this site : http://www.wprecipes.com/wordpress-tip-change-excerpt-length-depending-of-the-category
add_filter(‘excerpt_length’, ‘my_excerpt_length’);
function my_excerpt_length($length) {
if(in_category(14)) {
return 13;
} else {
return 60;
}
}

thanks for above categories wise code.

🙂

another one i finding… below site
http://themehybrid.com/support/topic/correct-method-to-reduce-length-of-teaser
I just copied and inform to all. Hi above site guy thanks for your code.
function excerpt($num) {
$limit = $num+1;
$excerpt = explode(‘ ‘, get_the_excerpt(), $limit);
array_pop($excerpt);
$excerpt = implode(” “,$excerpt).”…”;
echo $excerpt;
}

function content($num) {
$theContent = get_the_content();
$output = preg_replace(‘/]+./’,”, $theContent);
$limit = $num+1;
$content = explode(‘ ‘, $output, $limit);
array_pop($content);
$content = implode(” “,$content).”…”;
echo $content;
}
——————————————————————————————————-

function limit_content($max_char, $more_link_text = ‘Read More »’, $stripteaser = 0, $more_file = ”) {
if(is_numeric($max_char) &amp;&amp; $max_char &gt; 1) :
$max_char = (int)$max_char;
$title = get_the_title();
$title = apply_filters(‘the_title’, $title);
$title = strip_tags($title);
$title = strlen($title);
$max_char = $max_char – $title;
$content = get_the_excerpt($more_link_text, $stripteaser, $more_file);
$content = apply_filters(‘the_excerpt’, $content);
$content = str_replace(‘]]&gt;’, ‘]]&gt;’, $content);
$content = strip_tags($content);
$char = $content;
if((strlen($char) &gt; $max_char) &amp;&amp; ($espacio = strpos($char, ” “, $max_char))) :
$content = substr($content, 0, $espacio); $content = $content;
echo ”
<p>”;
echo $content; echo “…”;
if($more_link_text) :
echo ” <a title=”&quot;; the_title(); echo &quot;” href=”&quot;; the_permalink(); echo &quot;”>”.$more_link_text.”</a>”;
endif;
echo “</p>
“;
elseif(strlen($_GET[‘p’]) &gt; 0) :
echo ”
<p>”;
echo $content;
if($more_link_text) :
echo ” <a title=”&quot;; the_title(); echo &quot;” href=”&quot;; the_permalink(); echo &quot;”>”.__(‘Read More »’,’options’).”</a>”;
endif;
echo “</p>
“;
else :
echo ”
<p>”;
echo $content;
if($more_link_text) :
echo ” <a title=”&quot;; the_title(); echo &quot;” href=”&quot;; the_permalink(); echo &quot;”>”.__(‘Read More »’,’options’).”</a>”;
endif;
echo “</p>
“;
endif;
endif;
}

thanks 🙂
http://themehybrid.com/support/topic/correct-method-to-reduce-length-of-teaser

© 2020 Spirituality