Grow your CSS skills. Land your dream job.

WordPress table of events

  • # April 19, 2010 at 8:28 pm

    Hi Everyone,

    I have been working on a website for a client who are a dance group, and they wanted a page with a list of their shows that give the name of the show, the date, the venue, and a link to the company who is selling their tickets.

    I messed around with various Ideas including the one which Chris mentioned in his latest Screen cast where he was going to have an "editthis.php" page.

    In the end I came up with the following solution using custom fields and the wordpress loop to spit out the content.

    most of the ideas came from watching various screencasts of Chris’ mainly the ‘advanced uses for custom fields’.

    Heres the loop:

    Code:
    < ?php if ( (is_page('Shows')) ) {
    query_posts(array('showposts' => 100, ‘post_parent’ => 6, ‘post_type’ => ‘page’)); ?>

    < ?php while (have_posts()) {
    the_post(); //vital
    echo '

    ‘;
    echo ‘

    ‘;
    echo ‘

    ‘;
    echo ‘

    ‘;
    echo ‘

    ‘;
    echo ‘‘;
    }
    }
    ?>

    ‘;
    echo get_post_meta($post->ID, ‘show-Title’, true);
    echo ‘
    ‘;
    echo get_post_meta($post->ID, ‘Show-Venue’, true);
    echo ‘
    ‘;
    echo get_post_meta($post->ID, ‘Show-Date’, true);
    echo ‘
    ‘;
    echo ‘ID, ‘show-url’, true) , ‘”>Buy Tickets‘;
    echo ‘

    I know this probably isn’t the best solution, but its what I came up with :) if anyone has a better way of doing it feel free to let me know. I hope this is helpful to anyone who is wanting to do a similar thing.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".