Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,452 members, 7,954,775 topics. Date: Saturday, 21 September 2024 at 08:57 AM |
Nairaland Forum / Science/Technology / Webmasters / Problems With Wordpress Theme Development (704 Views)
Free Wordpress Theme Development Training / Wordpress Theme Development And Plugin Development Tutorial / Having Problems With Graphcard? (2) (3) (4)
Problems With Wordpress Theme Development by ace1(m): 4:53pm On Oct 24, 2012 |
Good day fellow Nairalanders, I'm new to WordPress theme development and I'm having problems with my home.php template page. I want to show the title, excerpt and a thumbnail of the featured image of the about page, two posts (title, Thumbnail and excerpt) from a category named events, and thumbnail images of post from a category named gallery on the home page. I've tried using the code below but still not working. I've attached a screenshot of what I'm trying to achieve Thanks ********************CODE********************** <?php query_posts('cat=2', 'posts_per_page=2'); if(have_posts()) while(have_posts()):the_post(); ?> <div class="txt"> <div class="image"> <?php $test = catch_that_image(); if(empty($test)) { ?><img src="<?php echo get_stylesheet_directory_uri().'/images/default1.jpg'; ?>"/> <?php } else {?> <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_stylesheet_directory_uri().'/lib/thumb.php'; ?>?src=<?php echo catch_that_image(); ?>&h=100&w=100&zc=1"/></a><?php } ?> </div> <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p> <p> <?php the_content() ; ?> </p> <div class="clear"></div> </div> <?php endwhile; wp_reset_query(); ?> ********************CODE********************** |
Re: Problems With Wordpress Theme Development by ace1(m): 9:43pm On Oct 24, 2012 |
So nobody can help me? |
Re: Problems With Wordpress Theme Development by Nobody: 11:38pm On Oct 24, 2012 |
First of all like i said always refer to the Wordpress Codex for anything but because you are fetch from multiple categories, you will need to make use of the Wp_Query Class, in the Function Reference the code is quite explanatory, to get a thumbnail there's a function called has_thumbnail and requires the post id or you can use wp_get attachment image src. also that code is totally wrong i have never seen a Wordpress function catch_that_image. http://codex.wordpress.org/Function_Reference |
Re: Problems With Wordpress Theme Development by Nobody: 11:38pm On Oct 24, 2012 |
using a Page and having a Template About Us is more preferable. |
Re: Problems With Wordpress Theme Development by ace1(m): 7:06am On Oct 25, 2012 |
pc guru: First of all like i said always refer to the Wordpress Codex for anything but because you are fetch from multiple categories, you will need to make use of the Wp_Query Class, in the Function Reference the code is quite explanatory, to get a thumbnail there's a function called has_thumbnail and requires the post id or you can use wp_get attachment image src. also that code is totally wrong i have never seen a Wordpress function catch_that_image. Thanks for your reply. The catch_the_image is not a Wordpress function. Its a function I downloaded n added 2 my functions.php that gets the featured image of the post and makes it easy 4 me 2 specify the thumbnail size anytime I call d function. I'll try using the WP_Query But there's something I don't understand. If I create an about page template, how do I display it on the home? By including it? |
Re: Problems With Wordpress Theme Development by Nobody: 10:23am On Oct 25, 2012 |
by putting this in a PHP file: <?php /* Template Name: RequestForm Page */ ?> The under the Page select template "RequestForm Page", my mail is okeowoaderemiATgmail.com, i can easily reply there. take care |
(1) (Reply)
Nigeria Gets First Software Incubation Centre / I Just Got A $20 LR Donation / How To Edit And Write New Scripts With Your Blackberry Device
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15 |