The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Programming Fundamentals" Dec 02 - 2:00 PM Eastern

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
    case 'block_two':

    < ?php
    //repeat as many times necessary




    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( );

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed