Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #920

    Hi

    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?

    #33380

    Hey,

    Having a quick look at the code, the query needs to be changed to include the “portfolio” custom post type.

    Change this:

    $portfolio_loop = new WP_Query("post_type=".$ptype."&cat=".$cat."&posts_per_page=".$count);

    to this:

    $portfolio_loop = new WP_Query("post_type=portfolio&cat=".$cat."&posts_per_page=".$count);

    That should get you going in the right direction :)

    James

    #33381

    Hi James

    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.

    #33382

    Hey,

    Try removing the:

    &cat=".$cat."

    code.

    James

    #33383

    Hi James, unfortunately still nothing…

    Here is the code — http://pastebin.com/QZHKQaru

    #33384

    Hey,

    I’ll have a play with this today, will get back to you soon. :)

    James

    #33385

    Hi James

    Strangely enough, it seems to be working today …

    http://www.chillybin.com.sg

    #33386

    Hey,

    This may have been because of a cached page. Glad it’s working now :)

    James

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Portfolio widget on homepage’ is closed to new replies.