Skip to main content
[Edit removed during grace period]
Source Link
Source Link

WPAlchemy output all metabox data for a certain field on one page

I was tasked with rebuilding works website as my first project for the job, and decided to go down the wpalchemy class route to help make meta boxes for my custom post type (I'm not going to use plugins).

I'm currently using (inside my theme page)

    $sidebar_excerpt = $sidebar_excerpt_meta->the_meta();

to make a variable for the meta data and then using

    if ($sidebar_excerpt) {
        echo '<img src="'.$sidebar_excerpt['sidebar_img_url'].'" />';
        echo '<p>'.$sidebar_excerpt['description'].'</p>';
    }

To check that the data exists before displaying it, although I have a dilemma! I want to actually display not just meta data from this particular page, but loop over all the database data for this particular metabox, does that make sense?

So each of my custom post type pages has 1 excerpt description and text, then overall on the actual template page I want to grab ALL the excerpt data from all pages from the content post type with this metabox data, then I'll limit the output to 3 or so.

I really want to achieve this although I'm scared I'll go over my deadline without working this one out? could any kind person please advise me or point me on the right track?

Many thanks Phil