• Resolved tom_taylor_85

    (@tom_taylor_85)


    Well, this is what I am trying to say…if I use this code on my index page: <?php the_content_rss('', TRUE, '', 20); ?> then it shows 20 words, which is GREAT! BUT, when I add a podCast I just get the stupid code, rather than the players itself…

    But when I add this code: <?php the_content(__('Read more'));?> then it shows the pod case on the index page, BUT it shows the entire content, but I only want it to display a little…

    How is this possible? Either allowing pod casts to on the index page, or restricting the amount words being displayed?

Viewing 12 replies - 1 through 12 (of 12 total)
  • @tom_taylor_85

    Sorry!! I have no any idea about this. I think that you can use conditions. LIKE

    if PODCAST
    see TITLE
    else
    EXCERPT or CONTENT

    Thanks
    Chinmoy

    Thread Starter tom_taylor_85

    (@tom_taylor_85)

    Well, is there a way to use <?php the_content(__('Read more'));?> but restrict the number of words to be shown?

    Yes. Put this function in theme’s functions.php file.

    function new_excerpt_length( $length ) {
    	return 40;
    }
    add_filter( 'excerpt_length', 'new_excerpt_length' );
    
    function new_excerpt_more($more) {
    	return 'Read more[.....]';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    And now change the function <?php the_content(__('Read more'));?> with <?php the_excerpt();?>

    Also use custom function

    function new_entry_post($number) {
    	$content = get_the_content();
    	$content = apply_filters('the_content', $content);
    	$content = preg_replace('@<script[^>]*?>.*?</script>@si', '', $content);
    	$content = preg_replace('@<style[^>]*?>.*?</style>@si', '', $content);
    	$content = preg_replace('|<img.*?src=[\'"](.*?)[\'"].*?>|i', '', $content);
    	$content = strip_tags($content);
    	$content = substr($content, 0, strrpos(substr($content, 0, $number), ' '));
    	echo $content;
    	echo "...";
    }

    Put it in functions.php file.

    Replacing the_content(_(‘Read more’)) with new_entry_post(20) .

    Thanks
    Chinmoy

    Thread Starter tom_taylor_85

    (@tom_taylor_85)

    That did restrict it, but now I get a different code where the pod cast should be… [Audio clip: view full post to listen]

    Any ideas?

    Thread Starter tom_taylor_85

    (@tom_taylor_85)

    Ok, I have an idea!

    Since in the categories that consists of podCasts, the only thing inside them is the podcast…

    How can I create and IF THEN code? i.e. If posts=music THEN <?php the_content(__('Read more'));?>

    if else, <?php the_excerpt();?>

    create a category “music” and put a post under music category.Now in your loop use this conditions
    if(in_category(put music id )){
    the_content(__(‘Read more’));?>
    }else{
    <?php the_excerpt();?>
    }

    Thread Starter tom_taylor_85

    (@tom_taylor_85)

    Do I add that code under the index page?

    yes. try once.

    Thread Starter tom_taylor_85

    (@tom_taylor_85)

    I did, it didn’t work…I am trying to replace the “<?php the_excerpt();?>” with the code you gave me…take a look please

    <td width="411">
        <?php if (function_exists('get_cat_icon')) get_cat_icon(); ?>
    	    <b><font size="+1"><span class="category"> <?php the_category(', ') ?></span></font></b>
    	    <?php the_time('F jS, Y') ?>
    
                <font color="white"><h1><a href="<?php the_permalink() ?>" rel="bookmark"></font>
            <?php the_title(); ?>
              </a></h1>
                <p>
    
    <link rel='stylesheet' id='podpress_frontend_styles-css' href='/wp-content/plugins/podpress/podpress.css?ver=3.0' type='text/css' media='all' />
    
    <?php the_excerpt();?>
                  <?php edit_post_link('Edit','',''); ?>
                </p>

    where is my code? its showing <?php the_excerpt();?>

    Thread Starter tom_taylor_85

    (@tom_taylor_85)

    I tried it many different ways as well…

    <td width="411">
        <?php if (function_exists('get_cat_icon')) get_cat_icon(); ?>
    	    <b><font size="+1"><span class="category"> <?php the_category(', ') ?></span></font></b>
    	    <?php the_time('F jS, Y') ?>
    
                <font color="white"><h1><a href="<?php the_permalink() ?>" rel="bookmark"></font>
            <?php the_title(); ?>
              </a></h1>
                <p>
    
    <link rel='stylesheet' id='podpress_frontend_styles-css' href='/wp-content/plugins/podpress/podpress.css?ver=3.0' type='text/css' media='all' />
    
    <?php if(in_category(4797)){
    the_content(__('Read more'));?>
    }else{
    <?php the_excerpt();?>
    } ?>
                  <?php edit_post_link('Edit','',''); ?>
                </p>
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘RSS feed error/displaying to much content…’ is closed to new replies.