Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to display certain pages, not posts – wordpress

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #31574
    Liam
    Member

    I’m setting up a WordPress powered site which has a blog and also a separate portfolio section.
    As I’m already using posts for the blog section, I’m using pages to display the individual projects with a parent page displaying thumbnail links to all of them (I’m using custom fields for the thumbnails).

    I’ve no problem displaying a list of latest posts on the home page, but how do I go about displaying thumbnails of my featured projects that click straight through to them?

    I’ve found this code that displays the most recent pages but that would include the parent page which I do not want showing up & it only generates the page names as links instead of thumbnails.

    Any help or advice would be much appreciated. :)

    
    $args=array(
    'showposts'=>5,
    'post_type' => 'page',
    'caller_get_posts'=>1
    );
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    while ($my_query->have_posts()) : $my_query->the_post(); ?>

    " rel="bookmark" title="Permanent Link to ">


    endwhile;
    }
    ?>

    #61342
    jacorre
    Participant

    I think you need to use child_of=id where id is the id of the parent page. So if your parent page id is 20 you would use child_of=20 and that would list all subpages for the parent page.

    #61343
    Liam
    Member

    Thanks,
    I’ve tried adding that to the existing code but it’s not had any effect! Am I missing something? :s

    'showposts'=>4,
    'post_type' => 'page',
    'child_of' => 128,
    'caller_get_posts'=>1
    #61164
    samara
    Member

    Liam, are you trying to post your latests projects in the blog page of WordPress or are you wanting to use a different page altogether to display your latest projects? Trying to better understand your question as i may have an answer.

    Mike

    #61115
    Liam
    Member

    I’m using a custom page template to display individual projects with a parent page to display links to all of the individual projects.

    What I’m having trouble with is displaying thumbnails links of my featured projects on my home page which is another custom page (not the blog feed).
    Hope that explains what I’m trying to do a bit clearer.

    #61081
    samara
    Member

    I think i am following you. I did a similar project recently where i had to ‘catagorize’ different listing for a used atv dealer. What i did was assign each listing a specific catagory, build a sepereate template for each by modifying the page.php, single.php and catagory.php pages. That allowed me to post to each catagory but segregate the post to their appropriate page. That gave me a main listing page, allowed me to click into a single page for each listing and make use of the built in pagination so that i can go to the previous or next listing while on the single page. here is the link to the project. http://www.onthesideav.com Last i checked the customer had not added all of his listings, but this should give you an idea of what i an trying to say. If this is what you are looking for, i will gladly show you how i did it.

    Mike

    #59983
    Liam
    Member

    Thanks but I don’t think that is what I need as I can already do that. I think I need to get the child_of=id working, but can’t figure it out.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.