Support » Plugin: Recipe Card » Get Image and Title

  • Resolved ibreezer


    Hi I want to create an index page much like the one you use yourselves on your site with just image and title and once you click on it you’ll get the full post with the entire recipe, so my question how would you go about to get the image and title in the simpliest way?

    Thanks in advanced.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author


    Hi –

    Our plugin doesn’t support what you are describing, but you could build something yourself using the information in the database. You should be able to access both the title and the image in the yumprint-recipe database.

    Well i made my own custom solution if anyone else would be intrested in creating a index/archive/category page for recepies

    	global $wpdb;
    	global $post;
    	$table_name = $wpdb->prefix . "yumprint_recipe_recipe";
    	$recipe_rows = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name"),ARRAY_A);
    	foreach($recipe_rows as $recipe){
    		$content = json_decode($recipe['recipe']);
    		$post = get_post( $recipe['post_id'], OBJECT );
    		setup_postdata( $post );
            <div <?php post_class(); ?>>
            <div class="entry-content">
            <a href="<?PHP the_permalink();?>"><img src="<?PHP echo $content->image;?>" /></a>
            <h3><?PHP the_title();?></h3>

    you can access all recipe data from the $content object here’s a list


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get Image and Title’ is closed to new replies.