nickaster
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Php help – mystery codeOkay thanks very much! This is helping me understand things a lot better.
So… In other words, the plugin changes the behavior of “the_content()” to slap in that ad code at the “more” spot.
So… regardless of how you construct the single.php page, as long as that plugin is active, it’s going to insert the code?
Why would single.php have originally included this?
<?php $single = sdac_triple_p_ad_code('single');?> <?php the_content(''. $single.''); ?>And again, why wouldn’t removing/editing that stop the plugin from affecting posts?
And finally, what’s the purpose of the HTML here?
<?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>
That’ll never show up because you’re already on the single page right? Why is there anything there? Does it have a purpose? I could just make it:
<?php the_content(‘WHAT IS THE POINT OF THIS’); ?>
And it wouldn’t make any difference?
Forum: Themes and Templates
In reply to: Php help – mystery codeFascinating…. but…. I also tried it by getting rid of any reference to $single in the single.php page itself – by using verbatim the code you suggested:
<div class="entry"> <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> <?php edit_post_link();?> <div class="tagzone"> <p class="tags"><span>Categorized:</span> <?php the_category(', ') ?><span class="sep">|</span><?php if (function_exists('sharethis_button')) { sharethis_button(); } ?></p> </div> </div>How does that plugin attack the page when it’s not even called for any more?
Forum: Fixing WordPress
In reply to: Getting Rid of “Smart Quotes”Thanks!
Check this page out:
http://www.triplepundit.com/2009/09/rosabeth-moss-kanter-speaks-about-valuecorp/
It’s obviously got smart quotes in the headline (you can see it in the source). The thing is, I wrote that headline myself and didn’t go anywhere near MS Word or any other editor. I just typed those quotes directly into the title field.
How in the world did that happen? Is it the browser? (Chrome and FF both show fancy quotes to me on PC)
Forum: Themes and Templates
In reply to: Php help – mystery codeFinally, if it matters, the plugin itelf is pasted here:
http://wordpress.pastebin.ca/1578557
It’s a pretty simple, one file plugin. Is there anything you see there that’s somehow re-writing, or over-writing what a default single page should show?
Forum: Themes and Templates
In reply to: Php help – mystery codeHere’s another quick question… this code you suggested:
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>What is the HTML in there supposed to do? I assume “the_content” is just whatever is in the body of the post, with whatever HTML and everything else is in that body field. But what happens if I type “yankee doodle” in there between the quotes? Does that stuff just go between the first and second part of the body, if “<!– more –>” is present? Since this is the single.php page, why would anyuthing show? Maybe that’s why nothing’s showing now?
Forum: Themes and Templates
In reply to: Php help – mystery codeHey, thanks. So, first, let me ask this:
I changed the single.php code to be exactly what you suggest above, and STILL, that ad code somehow sneaks its way into the post. It’s totally insane! I want to get rid of it, but more importantly I really just want to understand what the hell is going on.
I grepped all the theme files and the only place where that ‘sdac_triple_p_ad_code’ comes from is single.php and functions.php which I pasted above.
My head is just totally spinning. I know the core of WP is not hacked, but that’s what it feels like. How in the world can the totally default code you suggested STILL pull that ad? It’s nuts!
You can see the sucker in action here: http://www.triplepundit.com/2009/09/pge-quits-us-chamber-protesting-its-climate-change-stance/ (and all other article pages)
Forum: Themes and Templates
In reply to: Php help – mystery codeIf it makes any difference, deactivating the plugin nukes the entire site, so this clown I hired really buried it in there some place!
Forum: Themes and Templates
In reply to: Php help – mystery codeYou got it:
http://wordpress.pastebin.ca/1578317Thanks for taking a look. Yeah, there’s a custom plugin for those ads. I really don’t know why she went to the trouble of making a custom plugin for it – perhaps it has to be that way to insert the ad in an odd place like that?
I’m thinking about just deleting that plugin, then manually slapping in the ad code in the correct places, but I’m afraid it might be so deeply emnbedded it’ll massively mess things up. I don’t have a backup copy to tinker with right now.
Forum: Themes and Templates
In reply to: Php help – mystery codeThaks! Yeah, there’s only one, and it’s associated with comments somehow. Pasted below:
I assume that something about that widget/plugin is sneaking into whatever code generates the post body and slapping the ad code into it right at the point where the “<!– more –>” tag would sit. It’s just totally blowing my mind as to how/where it is coming from. I think I want to totaly recode it and get rid of this madnesss, but understanding it a little better would help!
// Comments if (function_exists('wp_list_comments')) { // comment count add_filter('get_comments_number', 'comment_count', 0); function comment_count( $commentcount ) { global $id; $_commnets = get_comments('status=approve&post_id=' . $id); $comments_by_type = &separate_comments($_commnets); return count($comments_by_type['comment']); } } function sdac_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>" class="completeComment"> <div class="gravatar"> <?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 32); } ?> </div> <div class="commentBox"> <p class="commentMeta"><?php comment_time('F d, Y');?> at <?php comment_time('G:i a T');?> | <?php comment_author_link();?> writes:</p> <?php if ($comment->comment_approved == '0') : ?> <p><?php _e('Your comment is awaiting moderation.') ?></p> <?php endif; ?> <?php comment_text(); ?> <p class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> <?php edit_comment_link();?></p> </div> </div> </li> <?php } ?>Forum: Themes and Templates
In reply to: Special Sidebar for Inside Pagesesmi, you rock. I owe you a beer or three.
final question. – It still looks like I have to make the widgets twice if they happen to be “text – arbitraty HTML and I want them on both sidebars, right?
Forum: Themes and Templates
In reply to: Special Sidebar for Inside PagesOkay, I give up on understanding that code.
I can create what appears to be a second sidebar, but is it possible to have the same widget on two sidebars? If I drag on to a new sidebar, it’s unavailable to be on the earlier one. WTF? I can’t believe how hard it is to do ANYTHING with WP without knowing php….ugh…
Forum: Themes and Templates
In reply to: Special Sidebar for Inside Pagesokay… so I did a little homework and discovered this page – http://www.blogohblog.com/adding-extra-sidebar-to-your-wordpress-theme/
Very helpful. Trouble is my functions.php file has loads of crap in it. I have no idea what most of it is. The relevant part about registering sidebars looks like this:
if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>', ));So… I vaguely understand that it’s trying to slap that div code around each widget and make the titles h3. But how do I tell it there are 2 sidebars?
Forum: Themes and Templates
In reply to: Special Sidebar for Inside PagesOkay wow. I didn’t know that was possible! very cool
SO… I just created a copy of “sidebar.php” and called it “sidebar-inner.php”
But… now what? If I use the following php on the single.php pages, for example:
<?php
if( is_home() || is_front_page() ) get_sidebar();
else get_sidebar(‘inner’);
?>;1) How does it know that ‘inner’ means “sidebar-inner.php” ?
2) How do I get side-bar inner to show up on the widget page where I can drag and drop?Forum: Themes and Templates
In reply to: Special Sidebar for Inside Pagesokay cool… but… if I did the two sidebar method, then how would the widgets get to both sidebars? Ie, if I just cloned one, then I’d still be in the same boat with not being able to insert something new on that second sidebar, right?
Forum: Themes and Templates
In reply to: Special Sidebar for Inside Pagesokay… thanks a lot. One wee problem. My sidebar seems to be entirely generated by widgets. The only code of relevance in sidebar.php is:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>What does this mean? Where is dynamic sidebar coming from? I can’t find it anywhere, but I know that it’s a vertical row of widgets.
Really, the only thing I’m trying to do is add a certain feature between two of the widgets – ie, a special widget, that only appears on inside pages.
Maybe there’s a better way to do this? Is is possible to author a widget that ONLY appears on inside pages? Do you know how to go about doing that?
Thanks!