• When using single-aol_ad.php I’m unable to see the AOL form underneath my Ads. I know I need to echo aol_form() but I’m not exactly sure I’m doing it right as it still doesn’t display.

    A snippet of my single.php file is as follows:

    			<div class="eight columns<?php if($author_bio == 'yes') { echo ' with-author-bio'; } ?>">
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				
    				<!-- BEGIN .post -->
    				<?php
    					if(get_post_format()) {
    						get_template_part( 'includes/format/' . get_post_format() );
    					} else {
    						get_template_part( 'includes/format/standard' );
    					}
    				?>
    				<!-- END .post -->
    
    				<?php
    					//show author bio
    					if($author_bio == 'yes') {
    						get_template_part( 'includes/author-info' );
    					}
    				?>
    
    				<?php comments_template(); ?>
    
    				<?php endwhile; endif; ?>
    			</div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Farhan Noor

    (@farhannoor)

    Hi

    Well, problem seems to be in between comments <!-- BEGIN .post --> and <!-- END .post --> The code which generates the output is written in one of the files in the folder your-theme/includes/format/ Have to check your theme thoroughly.

    Try this code in single.php file right after the line <!-- BEGIN .post --> <?php the_content(); ?> Make sure single-aol_ad.php is not present in your theme to make single.php file work.

    Regards
    Farhan.

    • This reply was modified 8 years, 1 month ago by Farhan Noor.
    Thread Starter joker2040

    (@joker2040)

    The standard post type used in includes/format is as follows

    <?php
    	$thumb = get_post_thumbnail_id();
    	$img_url = wp_get_attachment_url( $thumb,'full' );
    	$image = aq_resize( $img_url, 920, '', true );	
    
    	$post_lightbox = get_post_meta( get_the_ID(), 'mt_post_lightbox', true);
    	$img_alt = get_the_title();
    ?>
    
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">	
    	
    	<div class="post-inner clearfix">
    
    		<?php if ( !is_single() ) { ?>
    
    		<?php get_template_part('/includes/meta-top' ); ?>
    
    		<?php } ?>	
    
    		<?php if ( has_post_thumbnail() ) { ?>
    		<div class="post-item clearfix">
    			<div class="lightbox-photo">
    				<?php
    					switch( $post_lightbox ) {
    						case 'yes':
    							echo 	'<a class="image-overlay fancybox" href="'.$img_url.'" title="'.$img_alt.'">',	
    									'<img src="'.$image.'" alt="'.$img_alt.'" />',
    									'</a>';
    						break;
    						case 'no':
    							echo '<img src="'.$image.'" alt="'.$img_alt.'" />';
    						break;
    						default:
    						break;
    					}
    				?>
    			</div>
    		</div><!-- / .post-item -->
    		<?php } ?>
    
    		<div class="grid-post-inner">
    			<?php if ( !is_single() ) { ?>
    			<div class="post-top clearfix">
    				<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
    			</div>
    			<?php } ?>
    
    			<?php get_template_part('/includes/meta' ); ?>
    			
    			<div class="post-content clearfix">
    				<?php
    					if ( !is_single() ) {
    						global $more;
    						$more = 0;
    						the_content(__('Continue reading &rarr;', 'mthemes'));
    					} else {
    						the_content();
    					}
    				?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'mthemes' ), 'after' => '</div>' ) ); ?>			
    			</div><!-- / .post-content -->
    		</div><!-- / .grid-post-inner -->
    	</div><!-- / .post-inner -->
    	<div class="clear"></div>
    </div><!-- / .post -->
    <div class="clear"></div>

    When using single.php without single-aol_ad.php everything displays as it should. If I add <?php the_content(); ?> the content duplicates. I want to modify the sidebar displayed by using single-aol_ad.php and specifying a specific one. That part works except the submission form isn’t displayed when using single-aol_ad.php. As a test I replaced everything between <!-- BEGIN .post --> and <!-- END .post --> with the code above, the contents of the standard post type used in includes/format.
    Mike

    Plugin Author Farhan Noor

    (@farhannoor)

    Hi Mike
    Make copy of single.php and rename new file as single-aol_ad.php . Write <?php echo aol_form(); ?> right before the <!– END .post –>. It will show form on your website at the slug set in Plugin Settings. i. e. yourwebsite.com/ads

    Please note, echo aol_form(); function will not work outside of wordpress loop. IN your case, it will not work outside of <!-- BEGIN .post --> <!-- END .post -->

    Regards
    Farhan

    • This reply was modified 8 years, 1 month ago by Farhan Noor.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Question about single-aol_ad.php’ is closed to new replies.