Find Jobs
Hire Freelancers

229703 Wordpress loop code

N/A

Dalam Kemajuan
Disiarkan hampir 16 tahun yang lalu

N/A

Dibayar semasa penghantaran
Hello, I have a WP site (currently running v2.3.2, but about to go to v2.5.1). My home page is a static page that has a small amount of code that shows the last 3 posts from my blog (using a very custom version of Brian Gardner's Silhouette theme). The code I use is: - - - - - - - - - <!-- Mini Loop from Blog --> <h1>Latest From The Blog...</h1> <?php $how_many=3; //How many posts do you want to show require_once('./blog/[login to view URL]'); // Change this for your path to [login to view URL] file ?> <ul id="whats-new"> <? $news=$wpdb->get_results("SELECT `ID`,`post_title`,`post_excerpt` FROM $wpdb->posts WHERE `post_type`=\"post\" AND `post_status`=\"publish\" ORDER BY post_date DESC LIMIT $how_many"); foreach($news as $np){ $permalink=get_permalink($np->ID); $html= "<li><a href=\"". $permalink . "\">$np->post_title</a><br/ > $np->post_excerpt <br />   <a href=\"" . $permalink . "\">» Read the full post</a></li><br/ >\n"; //NOTE: you can easily alter the HTML above to suit echo $html; } ?> </ul> - - - - - - - - - However, I understand that will have to change for v2.5.1 anyway. But that includes posts from ALL categories, and I want to EXCLUDE a specific category (category ID 11, which is my Twitter Tools category). Basically I don't want the Twitter auto posts to appear in the loop on my home page. I don't know enough about the v2.5 coding to exclude a category from a simple loop. The loop contains, for each of the posts, Title (links to full post), excerpt and a "read more" link to the full post. I also want to be able to specify how many posts are included in the loop. Currently I have 3, but may later change to more posts. The final code MUST be v2.5.1 compatible -- doesn't have to be compatible with 2.3.2, as the site will be upgraded when the new loop code is installed into the theme page template. Once the code is completed, the full rights to use it as I see fit will then be transferred to me (although the winning bidder can also use the code themselves).
ID Projek: 1975945

Tentang projek

1 cadangan
Projek jarak jauh
Aktif 12 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
Dianugerahkan kepada:
Avatar Pengguna
Hi, Please check my PM With Regards Globalinformix
$5 USD dalam 0 hari
0.0 (1 ulasan)
0.0
0.0

Tentang klien

Bendera AUSTRALIA
Portarlington, Australia
5.0
6
Ahli sejak Ogo 27, 2006

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.