visiblemedia
Forum Replies Created
-
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptActually, I already tried that. This is the post (cut n’ paste from previous post) with what happened when I did:
<?php remove_filter('the_excerpt', 'wpautop'); ?>
from the template files (archive.php and index.php) and added:
function trim_excerpt($text) { return rtrim($text,'[...]'); } add_filter('get_the_excerpt', 'trim_excerpt');
back into the functions.php file and got the same kind of error.
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptapljdi: I took your function out because it conflicted with what I already have. I posted what I already have in hopes that you can guide me as to how to implement the trim so as not to conflict with what I already have. Can you help?
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptNope t31os’s function is not in my functions file anymore, this is what I have now in my functions file:
<?php if ( function_exists('register_sidebars') ) register_sidebars(2,array( 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h2>', 'after_title' => '</h2>', )); ?> <?php function widget_mytheme_search() { ?> <h2>Search</h2> <form id="searchform" method="get" action="<?php bloginfo('home'); ?>/"> <input type="text" value="type, hit enter" onfocus="if (this.value == 'type, hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'type, hit enter';}" size="18" maxlength="50" name="s" id="s" /> </form> <?php } if ( function_exists('register_sidebar_widget') ) register_sidebar_widget(__('Search'), 'widget_mytheme_search'); ?> <?php add_filter('comments_template', 'legacy_comments'); function legacy_comments($file) { if(!function_exists('wp_list_comments')) : // WP 2.7-only check $file = TEMPLATEPATH . '/legacy.comments.php'; endif; return $file; } ?>
and this is what I have in my archive and index templates:
<div class="entry"> <?php $count++; ?> <?php if ($count < 2) : ?> <?php the_content() ?> <?php else : ?> <?php remove_filter('the_excerpt', 'wpautop'); ?> <?php the_excerpt();?> <a href="<?php the_permalink() ?>">more</a> <?php endif; ?> </div>
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptooops, double post by accident, sorry
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptthen I tried adding this:
<?php function trim_excerpt($text) { return rtrim($text,'[...]'); } ?>
to this:
<?php $count++; ?> <?php if ($count < 2) : ?> <?php the_content() ?> <?php else : ?> <?php remove_filter('the_excerpt', 'wpautop'); ?> <?php the_excerpt();?> <a href="<?php the_permalink() ?>">more</a> <?php endif; ?>
so that it looks like this:
<?php $count++; ?> <?php if ($count < 2) : ?> <?php the_content() ?> <?php else : ?> <?php remove_filter('the_excerpt', 'wpautop'); ?> <?php function trim_excerpt($text) { return rtrim($text,'[...]'); } ?> <?php the_excerpt();?> <a href="<?php the_permalink() ?>">more</a> <?php endif; ?>
in the index.php and archive.php file and got all sorts of other errors… something about “cannot re declare the_exerpt” or something like that. and my sidebar disappeared.
Forum: Themes and Templates
In reply to: How to remove the […] from the excerpthmm, I commented out:
<?php remove_filter('the_excerpt', 'wpautop'); ?>
from the template files (archive.php and index.php) and added:
function trim_excerpt($text) { return rtrim($text,'[...]'); } add_filter('get_the_excerpt', 'trim_excerpt');
back into the functions.php file and got the same kind of error.
Forum: Themes and Templates
In reply to: How to remove the […] from the excerpthm… well that didn’t work, my exerpts ended up looking like this:
Last Chance for Freebie Play
February 28, 2009 | By RotoRob | Comments (0)Warning: rtrim() [function.rtrim]: Invalid ‘..’-range, no character to the left of ‘..’. in /nfs/c04/h01/mnt/60416/domains/rotorob.com/html/wp-content/themes/RotoRob_v7/functions.php on line 32
Warning: rtrim() [function.rtrim]: Invalid ‘..’-range, no character to the right of ‘..’. in /nfs/c04/h01/mnt/60416/domains/rotorob.com/html/wp-content/themes/RotoRob_v7/functions.php on line 32
If you don’t want your kid to wind up like this, teach him how to play fantasy sports properly. In the past couple of weeks, we’ve brought you articles designed to help you with your strategy when playing hockey or basketball fantasy leagues on Draftbug. Well, today (i.e., February 28) is your last chance to take advantage […] moreI wonder if the stuff in the template is conflicting with the stuff in the functions.php?
I have this in my template:
<?php $count++; ?> <?php if ($count < 2) : ?> <?php the_content() ?> <?php else : ?> <?php remove_filter('the_excerpt', 'wpautop'); ?> <?php the_excerpt();?> <a href="<?php the_permalink() ?>">more</a> <?php endif; ?>
where you would normaly find this:
<?php the_content() ?>
I do that so that I can display the first post in full, followed by 4 excerpts.
maybe the:
<?php remove_filter('the_excerpt', 'wpautop'); ?> <?php the_excerpt();?>
in the template is conflicting with the
function trim_excerpt($text) { return rtrim($text,'[...]'); } add_filter('get_the_excerpt', 'trim_excerpt');
in the functions.php?
Forum: Themes and Templates
In reply to: How to remove the […] from the excerpthm… I tried that but my functions file doesn’t have that in it. so I added it verbatim like this:
<?php
function wp_new_excerpt($text)
{
if ($text == ”)
{
$text = get_the_content(”);
$text = strip_shortcodes( $text );
$text = apply_filters(‘the_content’, $text);
$text = str_replace(‘]]>’, ‘]]>’, $text);
$text = strip_tags($text);
$text = nl2br($text);
$excerpt_length = apply_filters(‘excerpt_length’, 55);
$words = explode(‘ ‘, $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, ‘…’);
$text = implode(‘ ‘, $words);
}
}
return $text;
}
remove_filter(‘get_the_excerpt’, ‘wp_trim_excerpt’);
add_filter(‘get_the_excerpt’, ‘wp_new_excerpt’);
?>I just changed
array_push($words, ‘[…]’);
to
array_push($words, ‘…’);
and it kinda worked on the page, but something else in the above code interfered with publishing. I got an error having to do with functions.php and a header already being called or something like that.
so I took it out. ??
Is there a way to add JUST the array thing?
I assume this
<?php
function wp_new_excerpt($text)
array_push($words, ‘…’);
?>isn’t right, and I’m afraid to try it.
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptok, if anyone here is interested in the <p></p> solution, i found it:
<?php remove_filter(‘the_excerpt’, ‘wpautop’); ?>
that gets rid of the <p></p> now if i can only get rid of the […]
??
Forum: Themes and Templates
In reply to: How to remove the […] from the excerptI’m having this issue too, I’d like to remove the <p> that comes after that too so that the read more link immediately follows the excerpt without dropping down a line.
Forum: Themes and Templates
In reply to: show different content on category and homeAWESOME! that worked thanks.
Forum: Fixing WordPress
In reply to: Image upload failhere’s a wrinkle… i did that but this is what i found:
upload_tmp_dir no value no value
any idea how to overcome this?
Forum: Installing WordPress
In reply to: 3 Backslashes from ///quotes/// and apostrophes when searchingHey, i notice the searching with quotes now seems to work on https://mybabymonsters.com/stories have you found a solution?
Forum: Fixing WordPress
In reply to: archives forbiddenYES! woohooo! that worked thanks!
Forum: Fixing WordPress
In reply to: archives forbiddenhm, ok, that would explain why the months that DO work are not in folders … i guess thats all in the DB… So, any ideas why November and December are not working?
here’s the site address:
https://www.rotorob.com/check out November and December in the archives section. they generate errors, but the other months work fine.
Actualy i just had an idea… i imported the posts and archives from blogger. it got most of the way through importing and them stalled at this point
Files published… 35%
(and showed an error on the bottm of the browser
so i refreshed the page and it told me it was all finished successfuly.
i tried it again just now on a different blog (just a test blog on a subdomain) and the same thing happend.
Here’s the error details:
Line: 1
Char: 1
Error Not implemented
Code: 0
URL: https://basketball.rotorob.com/wpadmin/admin.php? import=blogger&noheader=true&blog=30345455i refreshed the page (cause it was stuck at 35%)
and it reloaded listing the blog as 90% imported.i clicked the 90% and it reloaded congratulating me on successfuly importing blogger into WP.
but this time all archive links DO work… should i reimport it from blogger? will that duplicate posts? will importing overwrite posts ive made since importing the first time?
(sorry for the long post)