{"id":1022,"date":"2009-07-24T23:02:13","date_gmt":"2009-07-24T23:02:13","guid":{"rendered":"http:\/\/tricks-collections.com\/?p=1022"},"modified":"2013-05-02T03:38:21","modified_gmt":"2013-05-02T03:38:21","slug":"wordpress-themes-hack","status":"publish","type":"post","link":"http:\/\/tricks-collections.com\/wordpress-themes-hack\/","title":{"rendered":"WordPress Themes Hack"},"content":{"rendered":"
This wordpress themes hack has tested. Modifying the wordpress themes code can cause your wordpress themes error. We cannot guarantee that problems resulting from modifications the wordpress themes. Use this tutorial at your own risk. I have tried all that mentioned here in wordpress 2.7, wordpress 2.7.1 and wordpress 2.8 and all wordked.<\/p>
A. Embed Google Adsense In First WordPress Post<\/strong><\/p> To place an ad after the first post title in your WordPress blog main page<\/p> <\/p> <?php if \t(have_posts())<\/p><\/blockquote> <\/li> <?php \t$count = 1; ?><\/p><\/blockquote> <\/li> <?php \tthe_content<\/p><\/blockquote> <\/li> <?php if ($count == 1) : ?> This places the ad within the first post.\u00a0 If instead you want the ad to appear between the first and second post, add the code from step 6 after the closing <\/div> tag for the \u201centry\u201d div that contains the line <?php the_content.<\/p> Source: http:\/\/www.devtopics.com\/embed-google-ad-in-first-wordpress-post\/<\/a><\/p> B. Adding Comment Numbers To Your WordPress Theme<\/strong><\/p> Here are the steps you can take to easily add numbers to your WordPress theme\u2019s comments section.<\/p> <?php \tif ( $comments ) : ?><\/p><\/blockquote> <\/li> <?php \t$i = 0; ?><\/p><\/blockquote> <\/li> <?php \tforeach ($comments as $comment) : ?><\/p><\/blockquote> <\/li> <?php \t$i++; ?><\/p><\/blockquote> <\/li> <span \tclass=”count”> .count \t{ You can adjust the stylesheet to fit your comment numbers into the placement and appearance that you want them to have.<\/p> Source: http:\/\/wphacks.com\/how-to-adding-comment-numbers-to-your-wordpress-theme<\/a><\/p> C. Separate WordPress Comments and Trackbacks<\/strong><\/p> <?php foreach ($comments as $comment) : ?><\/p><\/blockquote> <\/li> <?php $comment_type = get_comment_type(); ?> <?php endforeach; \/* end for each comment *\/ ?><\/p><\/blockquote> <\/li> <?php } \/* End of is_comment statement *\/ ?><\/p><\/blockquote> This will filter out all of the trackbacks and pingbacks from your main comments loop. Now we need to create a second comments loop to display the trackbacks and pingbacks.<\/li> <?php else : \/\/ this is displayed if there are no comments so far ?><\/p><\/blockquote> Immediately before the above code, you\u2019ll want to place this code:<\/p> <h3>Trackbacks<\/h3> You can adjust this code to display how you want to, including using a different header if you have a specific look for your header 3.<\/li> <\/ol>
\u2013 Insert your Google AdSense code here \u2013
<?php endif; $count++; ?><\/p><\/blockquote> <\/li>
<?php \techo $i; ?>
<\/span><\/p><\/blockquote> <\/li>
float:right;
padding: \t10px;
font-size:18px;
color:#000000;
}<\/p><\/blockquote> <\/li> <\/ol>
<?php if($comment_type == ‘comment’) { ?><\/p><\/blockquote> <\/li>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != ‘comment’) { ?>
<li><?php comment_author_link() ?><\/li>
<?php } ?>
<?php endforeach; ?>
<\/ol><\/p><\/blockquote>