Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

Vote the Post Plugin


  #1  
Old Jun 18, 2009, 06:54 PM
janey73
 
15 posts · Jun 2009
Vote the Post Plugin

I just posted this under my other userid, which wasn't connected to Paypal. So I created a new userid and was able to make a donation.

I'm using Theme Atahualpa 333 (really wonderful! Thank you.) and have installed the Vote the Post plugin.

It works beautifully on single post pages, showing the rating stars and a message.
http://innovation.marin.org/blog/c/?p=83

However, on the multiple posting pages, it loses the stars and the text, skips a line, and then places the question mark at the beginning of the post.

http://innovation.marin.org/blog/c/?cat=4

I tested it on a different theme and it worked fine, but I'd like to use it in Atahualpa 333. Any suggestions?

Many thanks.
  #2  
Old Jun 19, 2009, 03:50 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You have 'Only Excerpts' set in the option ATO->Paost or Excerpts->Posts or excerpts on CATEGORY pages? - change this to 'Full Posts' and the start sill show up.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jun 19, 2009, 12:15 PM
janey73
 
15 posts · Jun 2009
Thanks JuggleDad,

For overview reasons, we are needing the posts to be excerpts on the category pages. Then the user can drill down deeper if he/she wants to see more information.

I looked at the code being generated on the excerpt category pages, and it appears that Atahaulpa is putting <p> in various places just past the "Rating 3.00 out of 5" so that is cuts off the stars and puts the [?] on a new line. Any suggestions on how to get it to handle the same way on the excerpt category pages as on the full-post pages?

Much appreciated.

BTW, I just tried to donate to you in Firefox 3.0.11. there is no active button for:
" click this button >> donating to juggledad "
  #4  
Old Jun 20, 2009, 09:03 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The problem here is that when you choose to display an excerpt, Atahualpa calls the WordPress routine to provide the extract. Eventually you get to the function wp_trim_excerpt.

This routing takes the post, and calls the PHP function strip_tags() which, as you can guess from it's name, strips all HTMLT, XML, and PHP tags from a string.

Now the 'stars' in the Vote-the-post plugin are actually a clever <span> and set of <div.'s that the CSS ends up substituting a gif of a star for. BUT as a reault of the strip_tags call, this <span> and the <div>'s are removed, so there is no code for the CSS to cause stars to show up.

The other theme I tried this on, did infact show the stars, but it was because when displaying the categories, it displayed the entire post, not the excerpt.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jun 20, 2009, 08:54 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Post updated 6-24-2009:

You can stop Wordpress from stripping certain tags from excerpts by adding this:

function bfa_wp_trim_excerpt($text) { // Fakes an excerpt if needed
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text, '<p><span><div>');
$excerpt_length = 55;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, '<p>Continue reading <a href="'. get_permalink() . '">'. the_title('','',FALSE) . '</a></p>');
$text = implode(' ', $words);
}
}
return $text;
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'bfa_wp_trim_excerpt');


at the bottom of Atahualpa's functions.php, before the last closing ?> tag.


Customize the code:
  • <p><span><div> = tags to be "excluded from being removed". The tags you include here will be left untouched. Only the opening tag is required, i.e. <span> to hold back Wordpress from removing <span class="bla"> and </span> inside excerpts
  • 55 = Excerpt length (word count)
  • <p>Continue reading <a href="'. get_permalink() . '">'. the_title('','',FALSE) . '</a></p> = Replaces the default [...] ellipsis at the end of excerpts. To keep using the default [...] replace the green text in the code with [...]

Last edited by Flynn; Jun 24, 2009 at 09:01 AM. Reason: Completely replaced wrong code
  #6  
Old Jun 22, 2009, 05:50 PM
janey73
 
15 posts · Jun 2009
Thanks for the explanation, JuggleDad. That helps!

And thanks for the code, Flynn. I put it in, but it didn't seem to make a difference. It still stripped it out. http://innovation.marin.org/blog/c/?cat=3

Here's the bottom part of the function.php code with the change put in.

// new comment template for WP 2.7+, legacy template for old WP 2.6 and older
if (!function_exists('paged_comments')) {
include_once (TEMPLATEPATH . '/functions/bfa_custom_comments.php');
function legacy_comments($file) {
if(!function_exists('wp_list_comments'))
$file = TEMPLATEPATH . '/legacy.comments.php';

return $file;
}
add_filter('comments_template', 'legacy_comments');
}
remove_filter('the_excerpt', 'wptexturize');
?>

If this is too big of a pain, don't worry about it. thanks so much for your help.

Bookmarks

Tags
stars, vote, vote the post, voting



Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin : WP Print & WP Post Ratings do not work sns Plugins & Atahualpa 8 Feb 17, 2011 08:03 PM
[SOLVED] Next post and previous post links on top of single post page error susieswe Atahualpa 3 Wordpress theme 2 Jul 15, 2009 02:58 PM
WP-NicEdit Plugin ok with post but not ok with pages Ponics Plugins & Atahualpa 7 Jun 18, 2009 04:09 PM
Plugin Conflict w. Custom Post Background strangelove Plugins & Atahualpa 0 Mar 11, 2009 05:25 PM


All times are GMT -6. The time now is 11:31 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.