Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm developing a mobile theme and need to change the format of posts that are using the tag.

Can I add something to functions.php to change the format?

Ideally i'd like to make each page a list-item then display all inline on one page versus an individual pages, is that possible?

share|improve this question
add comment

1 Answer

One easy way to do this is to alter the global variables related to paging after calling the_post() in your loop.

global $post, $pages, $numpages, $multipage;
while( have_posts() ) {
    the_post();

    if( is_mobile() ) {
        $pages = array( $post->post_content );
        $page = $numpages = 1;
        $multipage = false;
    }

    // ... template
    the_content();
}

Basically what you're doing is un-doing the paging setup done in setup_postdata()

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.