I’m trying to increase the number in my the_excerpt from 55 to 85.
I’ve tried all the forums, the codex and plugins but nothing worked.
Can you let me know how I can do this with the VT Blogging theme?
Thanks
]]>Please help
function replace_content( $output) {
if (is_category(‘9’)) {
return ” ;
}
}
add_filter( ‘get_the_excerpt’, ‘replace_content’ );
Mahalo !!! (Thanks)
]]>the_excerpt()
or the_content()
on my home page.
The custom excerpt shows directly above the content when only the Excerpt should show.
I am using a plugin called “Advanced Excerpt” I disabled it to test the issue, and it is not causing (or fixing) this problem.
Can this be fixed within functions.php codex? Or in another PHP file? If so, please let me know which code in which file to replace.
You can see this issue in-action when you visit page two of my blog: Tajanator.com/page/2 and scroll down to the post called “Regarding My Sudden Obsession With Foreign Fantasy Rock Music”.
]]>I’m stuck. I’m working on a site that has a Parallax Banner that takes up most of the screen height.
I’m trying to modify the function that creates my “read more” links after my excerpts in my Recent Posts to link to the #content id in my single.php (opening the page after the tall banner).
I’m using the suggestion from the Codex on Customizing the Read More, (see below) but I don’t know enough .php to be able to insert the anchor tag (#content) that I’d like to postpend to the get_permalink without breaking the code.
// Replaces the excerpt "Read More" text by a link
function new_excerpt_more($more) {
global $post;
return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
https://sottovocepress.com/brian/ and https://sottovocepress.com/brian/ashley-madison-hackers-come-together-to-fight-marital-infidelity/
Thoughts?
Many thanks in advance!
]]>I’m stuck. I’m working on a site that has a Parallax Banner that takes up most of the screen height.
I’m trying to modify the function that creates my “read more” links after my excerpts in my Recent Posts to link to #content id in my single.php.
I’m using the suggestion from the Codex on Customizing the Read More, (see below) but I don’t know enough .php to be able to insert the anchor tag (#content) that I’d like to postpend to the get_permalink without breaking the code.
// Replaces the excerpt "Read More" text by a link
function new_excerpt_more($more) {
global $post;
return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
Thoughts?
Many thanks in advance!
]]>All I want to do is add the Post title to ‘the-excerpt’ at the bottom of the text, instead of the ‘Read More’ link.
I have searched the Codex, and found this snippet below which adds a ‘more’ link, when added to functions.php
// Replaces the excerpt “more” text by a link
function new_excerpt_more($more) {
global $post;
return ‘<a class=”moretag” href=”‘. get_permalink
($post->ID) . ‘”>Read More…’;
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);
This works fine, and links to the right Post, but of course just displays ‘read more’ or some added text.
So how do I make it fetch the Post title instead?
Any ideas please?
Thanks.
On other themes it’s a seemingly a simple matter to replace
<?php the_content(); ?>
with
<?php the_excerpt(); ?>
Looks like convention went out the window with 2012 as neither is used, so my question is how do I get excerpts to show on Category pages instead of full Posts?
Any ideas how to do this please?
I’m not a coder, so need idiot-proof instructions, thanks
Here’s the code from category.php in case it helps
get_header(); ?>
<section id=”primary” class=”site-content”>
<div id=”content” role=”main”>
<?php if ( have_posts() ) : ?>
<header class=”archive-header”>
<?php if ( category_description() ) : // Show an optional category description ?>
<div class=”archive-meta”><?php echo category_description(); ?></div>
<?php endif; ?>
</header><!– .archive-header –>
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( ‘content’, get_post_format() );
endwhile;
twentytwelve_content_nav( ‘nav-below’ );
?>
<?php else : ?>
<?php get_template_part( ‘content’, ‘none’ ); ?>
<?php endif; ?>
</div><!– #content –>
</section><!– #primary –>
What I’m trying to achieve-
I want to have blog post, that shows only the excerpt, so I’ve modified content.php and change
<?php
the_content( sprintf(
/* translators: %s: Name of current post. */
wp_kses( __( 'Continue reading %s <span class="meta-nav">→</span>', 'cthulhu' ), array( 'span' => array( 'class' => array() ) ) ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
) );
?>
to
<?php the_excerpt(); ?>
Now, I’m able to see my custom excerpt, but wordpress doesn’t limit the lenght of excerpt – > I’ve puted 100 words to Excerpt and there’s seems to be no limit in content (which should be 55 words by default).
I’ve also tried to add function to functions.php
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
it doesn’t work.
I’ve also tried different themes – all version of Twenty- and it’s still same.
Maybe I’m just to tired, but I’m struggling with this so hard…
]]>I guess summaries of the posts are in the main(index) page, I looked at template’s index.php but there is no the_content(), I tried few other templates, including default ones, but the same problem. Is the_content() method is no longer used or am I blind?
Thanks for help!
]]>