I’ve been trying to work this out for myself but have come up against a bit of a stumbling block. What i’m trying to do at my website http://www.chillybin.com.sg is to have 1 item from the post_type portfolio in the footer using the widget code which i duplicated from the news widget (code: http://pastebin.com/2YacDbY1 ).
However, it doesn’t seem to be bringing up anything from the post type. I can’t see any problems with the loop or coding, but i’m sure i’ve missed something.
Does anyone have any idea?
Having a quick look at the code, the query needs to be changed to include the “portfolio” custom post type.
$portfolio_loop = new WP_Query("post_type=".$ptype."&cat=".$cat."&posts_per_page=".$count);
$portfolio_loop = new WP_Query("post_type=portfolio&cat=".$cat."&posts_per_page=".$count);
That should get you going in the right direction :)
Thanks for your help, I had already scripted the post type into the WQ_Query loop, I created a new field in the Widget options that would allow me to specify the post_type. Nevertheless, I tried your hardcoded solution and I still don’t get any information brought up.
Hi James, unfortunately still nothing…
Here is the code — http://pastebin.com/QZHKQaru
I’ll have a play with this today, will get back to you soon. :)
Strangely enough, it seems to be working today …
The topic ‘Portfolio widget on homepage’ is closed to new replies.