I’m using “the_content_rss” to display a snippet of text from a post under a photo thumbnail on my homepage. Works great but the snippet shows the WordPress gallery shortcode () that I’ve inserted to display a bunch of photos for that post.
I know I could move the shortcode to the end of my post, but then it would mess up the page’s layout.
Is there a way to tell “the_content_rss” to ignore or hide the gallery shortcode the way it can be told to strip HTML code?
]]>the_content_rss('', TRUE, '', 50);
How to do?
]]>I have enabled my homepage to display blog posts. Some of the posts however have links, but these are disabled on the homepage. Any way to enable them? I was reading about the “the_content_rss” method and thought changing it would solve my problem, but no luck. It is as follows:
<?php the_content_rss(”, TRUE, ”, 37); ?>
There is supposed to be a fifth parameter, encode_html, that I thought would enable links, but that didn’t seem to work either, unless something else went wrong. Any advice would be greatly appreciated.
]]>the_content_rss('', TRUE, '', 25);
the_content_rss('', TRUE, '', 40);
Both these functions work fine and its gives me content that is 25 or 40 words long, but none of the other parameters work.
https://codex.www.ads-software.com/Function_Reference/the_content_rss
I have tried:
the_content_rss('more...', TRUE, '', 25);
but it always defaults to “…”
This doesn’t change anything either:
the_content_rss('', FALSE, '', 25);
I know its deprecated but what does that mean in terms of functionality for right now?
I want to be able to display “more…” instead of “…”
]]>Below is the code that the plugin is using:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="imageElement">
<h2><?php the_title() ?></h2>
<?php
if(get_option('gallery-use-featured-content')) {?>
<p><?php $key="featuredtext"; echo get_post_meta($post->ID, $key, true); ?></p>
<?php
} else {
?>
<p><?php the_content_rss('', false, '', $wordquantity); ?></p>
<?php
}
?>
Could anyone help me figure out why the function would not be returning any text? Thanks
]]>I’m getting excerpts like
Geskryf deur Francois van Deventer Esters, Jongelinge, Bekommerdes
Bold by me to highlight the problem.
The text is generated by this code: (as far as I can tell)
<?php the_content_rss(”, TRUE, ”, 50); ?>
I’m using the GracioMag theme.
How could I strip the unwanted code?
Thanks
]]>I have been using WP for a long time now and have never come across this problem.
I am trying to use either ‘the_content_rss’ or just ‘content_rss’ on my homepage to display some content from a random post.
Original actual code I am trying to use is <?php the_content_rss('', TRUE, '', 14); ?>
All I am getting as output is the first character of the posts text and nothing more. I have tried many variations and just getting the same again, as though somewhere something is limiting it to 1 single character.
Any ideas? I am using 2.8.3!
Many thanks!
]]>Why?
feed-atom.php is too.
]]>help….? :/
]]>I tried passing it through a crop function afterwards but the_content_rss simply displays as is (even if trying to store it as a string). Passing the_content through works fine, then limiting it to a number of characters using a crop function, but the problem arises when there is a link early in the post so it’ll cut off like:
<p>this is a <a href="https://www...</p>
which tends to break the layout.
]]>