Grow your CSS skills. Land your dream job.

WordPress php tough question

  • # August 9, 2012 at 3:37 am

    I am working on making a theme in WordPress. I am using SMOF to code the admin area. here is the documentation. SMOF Documentation The SMOF comes with a way to split up a page into block sections. You can then drag and re arrange these blocks. My problem is that I need to query the database of a specific category to get the posts. That is the easy part. The hard part is putting the query into a switch statement so that each post can be moved using the block features. Here is the code snipped for the options framework


    < ?php
    $layout = $data;

    if ($layout):

    foreach ($layout as $key=>$value) {

    switch($key) {

    case 'block_one':
    ?>


    < ?php
    break;
    case 'block_two':
    ?>


    < ?php
    break;
    //repeat as many times necessary

    }

    }

    endif;
    ?>

    Here is my query


    < ?php query_posts( array ( 'category_name' => 'homepage', 'posts_per_page' => -1 ) );
    global $more;
    $more= 0;

    while ( have_posts()) : the_post();
    the_excerpt( );


    endwhile;
    wp_reset_query();
    ?>
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".