Home » Topics » Pods 1.x » Pods not appearing in MobilePress theme
Pods not appearing in MobilePress theme
This topic contains 3 replies, has 2 voices, and was last updated by databell 2 years, 1 month ago.
-
AuthorPosts
-
April 6, 2011 at 5:58 pm #165494
I’m using MobilePress so I can display a mobile version of my clients’ site for devices like many of us are doing these days. Problem is since they use their own themes instead of the standard themes, the Pod pages don’t show up. I created a version of MobilePress’ iPhone page.php template and added the pods code but all I get when I go to the page itself is the Page Not Found message at the bottom of the code. How can I make the Pods data appear? Is it possible at all?
Here’s the code I’m using to display (or try to) Pods data:
<?php
1234567891011121314151617181920$found_artists = false;global $pods;$artists_slug = 'artists-name';$artists = new Pod('artists', $artists_slug);if( !empty( $artists ->data ) ){$found_artists = true;// set our variables$artists_id = $artists->get_field('id');$artists_name = $artists->get_field('name');$artists_category = $artists->get_field('category');$artists_biography = $artists->get_field('biography');$artists_slug = $artists->get_field('slug');// data cleanup$artists_biography = wpautop( $artists_biography );}?>
1234567891011121314151617181920212223242526272829303132333435363738394041424344<div id="contentwrap"><?phpif (isset($_GET['comments'])) {if (have_posts()): while (have_posts()): the_post();comments_template();endwhile; endif;}elseif (isset($_GET['postcomment'])) {if (have_posts()): while (have_posts()): the_post();comments_template($file = '/postcomment.php');endwhile; endif;}else {?><?php if (have_posts()): while (have_posts()): the_post(); ?><h2><?php the_title(); ?></h2><div class="post" id="post-<?php echo $artists_id; ?>"><?php echo $artists_biography; ?></div><?php endwhile; else: ?><h2>Page Not Found</h2><div class="post"><p>Sorry, The page you are looking for cannot be found!</p></div><?php endif; ?><?php}?></div><?php get_footer(); ?>
April 6, 2011 at 8:36 pm #165495You’ve put your content within a ‘WP Loop’, that have_posts() / the_post / the_title() stuff — if there isn’t a WP Page or Post (or CPT) on the page it will just not output at all and give you the Page Not Found error.
Is that what’s happening for you?
April 7, 2011 at 4:29 am #165496April 7, 2011 at 4:37 am #165497OK, Scott. Just deleted it. Solved the problem. Pods are now displaying. Yay! Thanks.
-
AuthorPosts
You must be logged in to reply to this topic.