the_content() displaying random data??
-
This is really bothering me cause I can’t figure it out…
https://highheelsandhardhats.com/blog/
so far I have made the home page a static page, and im trying to make the blog page list all the posts for the blog.
I basically opened the index file, copied and pasted the code that was used to display the blog posts on the homepage, pasted into page.php, so that page.php checks if its the blog page, if it is, display blog posts, if not, show regular content of that page.
that may not be the best way but whatever im super tiredanyway, its not showing the posts?? its showing information from content i dont even know where it came from. first, its showing the name of the page, and then the image (the one of the woman) is just a pic i used on the about page, i have no idea how it managed to move into this page too.. very weird
heres the code for page.php
<?php get_header(); ?> <div id="content"> <? if (is_page('12')) { ?> <div id="post-<?php the_ID(); ?>" class="postbox"> <div class="post-thumb"> <?php tj_show_thumb('boxthumbw', 'boxthumbh'); ?> </div> <!--end .post-thumb--> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="post-date"> <p><?php _e('Posted by', 'themejunkie'); ?> <span class="post-author"><?php the_author_posts_link(); ?></span> <?php _e('on', 'themejunkie'); ?> <?php the_time('F j, Y'); ?> · <span class="post-comments"><?php comments_popup_link(__('0 Comment', 'themejunkie'), __('1 Comment', 'themejunkie'), __('% Comments', 'themejunkie')); ?></span></p> </div> <div class="post-exerpt"> <?php tj_content_limit(get_theme_mod('limit_char')); ?> <div class="post-info"> <?php _e('Filed in', 'themejunkie'); ?>: <?php the_category(', ')?> </div> </div> <!--end .post-excerpt--> <div class="clear"></div> </div> <? } else { if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h2 class="pagetitle"><?php the_title(); ?></h2> <div class="entry"> <?php the_content(''); ?> <?php edit_post_link('('.__('Edit', 'themejunkie').')', '', ''); ?> </div> <!--end .entry--> <?php endwhile; ?> <?php else : ?> <h2 class="pagetitle"><?php _e('Page Not Found', 'themejunkie'); ?></h2> <div class="entry"> <p><?php _e('The page you trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.', 'themejunkie') ?></p> </div> <!--end .entry--> <?php endif; ?> <? } ?> </div> <!--end #content--> <?php get_sidebar(); ?> <?php get_footer(); ?>
ehres the code for the index page if that helps at all
<?php get_header(); ?> <div id="column1"> <?php if (have_posts()) : ?> <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=".get_theme_mod('home_cat')."&paged=$page"); while ( have_posts() ) : the_post() ?> <?php if (get_theme_mod('homestyle') == 'blog') { ?> <!--begin of blog style--> <div id="post-<?php the_ID(); ?>" class="postbox"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="post-date"> <p><?php _e('Posted by', 'themejunkie'); ?> <span class="post-author"></span><?php the_author_posts_link(); ?></span> <?php _e('on', 'themejunkie'); ?> <?php the_time('F j, Y'); ?> <?php _e('in', 'themejunkie'); ?> <?php the_category(', ')?> · <span class="post-comments"><?php comments_popup_link(__('0 Comment', 'themejunkie'), __('1 Comment', 'themejunkie'), __('% Comments', 'themejunkie')); ?></span></p> </div> <!--end .post-date--> <div class="entry"> <?php the_content(); ?> <div class="tags"> <?php the_tags(); ?> <?php edit_post_link('('.__('Edit', 'themejunkie').')', '', ''); ?> </div> <!--end .tags--> </div> <!--end .entry--> <div class="clear"></div> </div> <!--end .postbox--> <!--end of blog style--> <?php } else { ?> <!--begin of magazine style--> <? if (is_page('12')) { ?> <div id="post-<?php the_ID(); ?>" class="postbox"> <div class="post-thumb"> <?php tj_show_thumb('boxthumbw', 'boxthumbh'); ?> </div> <!--end .post-thumb--> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="post-date"> <p><?php _e('Posted by', 'themejunkie'); ?> <span class="post-author"><?php the_author_posts_link(); ?></span> <?php _e('on', 'themejunkie'); ?> <?php the_time('F j, Y'); ?> · <span class="post-comments"><?php comments_popup_link(__('0 Comment', 'themejunkie'), __('1 Comment', 'themejunkie'), __('% Comments', 'themejunkie')); ?></span></p> </div> <div class="post-exerpt"> <?php tj_content_limit(get_theme_mod('limit_char')); ?> <div class="post-info"> <?php _e('Filed in', 'themejunkie'); ?>: <?php the_category(', ')?> </div> </div> <!--end .post-excerpt--> <div class="clear"></div> </div> <? } else { } ?> <!--end .postbox--> <!--end of magazine style--> <?php } ?> <?php endwhile; ?> <div class="clear"></div> <div class="pagination"> <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?> <div class="left"><?php previous_posts_link(__('Newer Entries', 'themejunkie')) ?></div> <div class="right"><?php next_posts_link(__('Older Entries', 'themejunkie')) ?></div> <div class="clear"></div> <?php } ?> </div> <!--end .pagination--> <?php else : ?> <?php endif; ?> </div> <!--end #column1--> <?php get_sidebar(); ?> <?php get_footer(); ?>
- The topic ‘the_content() displaying random data??’ is closed to new replies.