chryses
Forum Replies Created
-
Hi,
Theshadow
class and the extra css is always applied to imageForum: Themes and Templates
In reply to: [Toujours] Excerpt functionHi @aleone89
Thank you, but that particular option is not working like expected with this template, perhaps because it is old or maybe for some other modifications, but is a good starting point for me.Yes I’m working on a child theme, some little fix or modification are always needed, I think.
I’ll try to find a way to implement this basic function, I made some test and worked on blog page, but when I enter into the article I always see the continue reading link, so, I’ve to figure out how to show excerpt only on blog page and not inside the articleThanks for the link, I’ll look also inside it
Do you know a good free theme where I can “extract” the excerpt function? I tried to take a look at twentytwentyone but seems to be “splitted” in more than one file
Forum: Themes and Templates
In reply to: [Toujours] Excerpt functionThank you @macmanx for your reply.
Actually I don’t like more-block, just because is a writer site/blog, you know, I want to create curiosity by writing a little summary or synopsis of the article, without necessarily reporting the first bit of it.
Do you know a way to “substitute” from normal behavior to “excerpt mode”?
I mean, I’m trying to modify the code and I found excerpt hook filter in functions.phpfunction toujours_excerpt_length( $length ) { return 35; } add_filter( 'excerpt_length', 'toujours_excerpt_length', 999 ); /** * Replaces the excerpt "more" text by a link */ if ( ! function_exists( 'toujours_excerpt_continue_reading' ) ) { function toujours_excerpt_continue_reading() { return '… <a href="' . esc_url( get_permalink() ) . '">' . sprintf( esc_html__( 'More', 'toujours' ), '<span class="screen-reader-text"> "' . get_the_title() . '"</span>' ) . '</a>'; } } add_filter( 'excerpt_more', 'toujours_excerpt_continue_reading' );
Now, I’m pretty sure that the part that I need to modify is inside content.php file in template-parts folder, so I see this
<?php if ( '' !== $post->post_content ) { ?> <div class="entry-content"> <?php the_content( sprintf( /* translators: %s: Name of current post. */ wp_kses( __( 'Continue reading %s <span class="meta-nav">→</span>', 'toujours' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '<span class="screen-reader-text">"', '"</span>', false ) ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'toujours' ) . '</span>', 'after' => '</div>', 'pagelink' => '<span class="page-links-num">%</span>' ) ); ?> </div><!-- .entry-content --> <?php } ?>
and if I remove this part
<?php the_content( sprintf( /* translators: %s: Name of current post. */ wp_kses( __( 'Continue reading %s <span class="meta-nav">→</span>', 'toujours' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '<span class="screen-reader-text">"', '"</span>', false ) ) ); ?>
No article content is showed, for this I think is the right section, but I can’t understand why the excerpt is not showed, I mean, I set it up inside the article post but is not even showed, but if I install a plug-in “Advanced Excerpt” and I set to make an excerpt after 20 chars (space included) nothing happen, but if I set this option on “Generate excerpts even if a post has a custom excerpt attached.” then every post is trimmed after 20 chars and is correct. So this tell me that Toujours theme use the article content like an excerpt, or this’s what I think. I don’t know if I have explained myself well.
And I also noticed that featured content are reported with the correct excerpt, so like you said, every template have a different way to show excerpt. I searched a bit and featured content by jetpack that call some “post” function and report an “array”, but I’m not an expert on WordPress, so I need some help, and I’ve to ask
For these reasons I think that $post->post_content is doing the “bad job”, also because the “Advanced Excerpt” plug-in automatically hooks on the_excerpt() and the_content() but I need to force it in order to use it.So, let assume that a theme don’t have excerpt support, how can I add this?
Any idea?
J
Forum: Themes and Templates
In reply to: [Toujours] Excerpt functionHi, thanks for your reply
I mean that if I do a blog post and I specify an excerpt inside the post I can’t see it in the blog page, for example.
I made a post with this inside:Could you explain a little more what you mean that the excerpt function doesn’t work? What steps are you following and what exactly happens? Also, it would be helpful if you could share the URL of the site you’re working on. Thanks!
then I specify the excerpt like this:
Could you explain?
On the blog page I see all the post and not the excerpt, but if I switch to twentytwentyone theme, I can see the post with the excerptSure the url is https://www.goccediveleno.it, not yet finished, I’m working on it … tell me if you maybe need some English post or some screen to see what happen
Thank you again
J
Hi, I found the problem!
Inside .htaccess there was this block of codeRewriteCond %{REQUEST_URI} .(wp-comments-post)\.php* RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule ^(.*)$ https://%{REMOTE_ADDR} [R=301,L]
Directly from my web host, to prevent spam
Thanks a lot for your support
Hi, always thanks for your reply.
Unfortunately, in both cases it didn’t work.I’m definitely not an expert on WP, but as a computer geek I’m guessing it might be something related to some variable in jetpack and the server.
Because if I disable “Let visitors use a WordPress.com, Twitter, Facebook, or Google account to comment” then I am able to post a comment (the one you see on the blog was done so)
What do you think?
Can I post some configuration files or report some debug logs to help?Sure, is not yet completed but is not a problem
https://www.goccediveleno.it
I’m trying different solutions too ??