Hello! I am having problems with shortcodes... they are not working (they display the actual shortcode). If I replacewithCode:<?php echo $ps->post_content;/*the_content();*/ ?>the shortcodes work, but then the same content displays for every post!Code:<?php the_content();?>
Any ideas? The following is my single.php file
Code:<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <?php /*?><div id="container"> <div id="content" role="main"><?php */?> <div id="interior_large"> <img src="<?php echo get_bloginfo( 'template_url' ); ?>/images/BOXES_SECONDARY_TOP.jpg" /> <div id="boxes_for_pages"> <div id="boxes_for_pages_left"> <?php get_sidebar(); ?> </div> <div id="boxes_for_pages_right"> <?php /* Run the loop to output the post. * If you want to overload this in a child theme then include a file * called loop-single.php and that will be used instead. */ //get_template_part( 'loop', 'single' ); $posts = explode('/',$_SERVER['REQUEST_URI'],-1); function get_post_by_slug($post_name) { global $wpdb; $post = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type='post'", $post_name )); if( $post ) { return get_post($post); } return null; } if($posts[3]!='') { $ps = get_post_by_slug($posts[3]); } else { $ps = get_post_by_slug($posts[2]); } /*echo "<pre>";print_r($ps);echo "</pre>";*/ //query_posts($ps); ?> <div id="post-<?php echo $ps->ID; ?>" <?php post_class(); ?>> <div id="boxes_for_pages_right_text"><?php echo $ps->post_title; ?></div> <div id="boxes_for_pages_right_text_sub"> <div class="entry-meta"> <?php /*twentyten_posted_on();*/ ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php echo $ps->post_content;/*the_content();*/ ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?> <div id="entry-author-info"> <div id="author-avatar"> <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?> </div><!-- #author-avatar --> <div id="author-description"> <!--<h2>--><?php /*printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2> <?php the_author_meta( 'description' );*/ ?> <!--<div id="author-link"> <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?> </a> </div>--><!-- #author-link --> </div><!-- #author-description --> </div><!-- #entry-author-info --> <?php endif; ?> <div class="entry-utility"> <?php /*twentyten_posted_in();*/ ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> </div> </div> </div> </div> <img src="<?php echo get_bloginfo( 'template_url' ); ?>/images/BOXES_SECONDARY_BTTM.jpg" /> </div> <?php /*?></div><!-- #content --> </div><!-- #container --><?php */?> <?php get_sidebar(); ?> <?php get_footer(); ?>


LinkBack URL
About LinkBacks
Reply With Quote
