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


    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 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: ).

    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.

    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 :)



    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.



    Try removing the:





    Hi James, unfortunately still nothing…

    Here is the code —



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



    Hi James

    Strangely enough, it seems to be working today …



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


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

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