WordPress.org

Ready to get started?Download WordPress

Forums

Posts in Page
[resolved] Comment On Post! (3 posts)

  1. Carl Fox
    Member
    Posted 1 year ago #

    Hi Eric,

    Love the simplicity of this plugin.

    I have used it to add a full post into a page and would like to now allow the use of the comments feature on that post as well, but I'm unsure if I can make this work.

    This is the page in question!

    Currently, when I click on 'Leave a comment', it jumps off to another 'page', which is not the intention (I would like it to stay where it is).

    Can I achieve this?
    Am I asking too much?
    Any advice would be greatly appreciated,
    thanks,
    Carl.

    http://wordpress.org/extend/plugins/posts-in-page/

  2. Carl Fox
    Member
    Posted 1 year ago #

    Hi Eric,

    Due to the site being constantly updated the appearance mentioned above has changed, however, I would still like to achieve the stated result (comment on posts-in-a-page without leaving that page).

    Maybe this will clarify even further, what I would like is to put a few posts into a page, one after the other, with each of those posts having a comments section underneath it.

    Anybody with any advice here would be greatly welcomed,

    Thanks,

    Carl.

  3. Eric Amundson
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Hey Carl,

    Thanks for your patience in receiving a reply.

    Okay, so this is a question I haven't had before, but I do believe it's possible. It may depend a bit on your theme.

    Step 1
    First thing I'd do is copy the posts_loop_template.php file from your posts-in-page plugin directory to your theme folder.

    Step 2
    Then, open your new file and you'll see something like this:

    <!-- NOTE: If you need to make changes to this file, copy it to your current theme's main
    	directory so your changes won't be overwritten when the plugin is upgraded. -->
    
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post">
    	<!-- This is the output of the post TITLE -->
    	<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
    	<!-- This is the output of the EXCERPT -->
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div>
    
    	<!-- This is the output of the META information -->
    	<div class="entry-utility">
    		<?php if ( count( get_the_category() ) ) : ?>
    			<span class="cat-links">
    				<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<?php
    			$tags_list = get_the_tag_list( '', ', ' );
    			if ( $tags_list ):
    		?>
    			<span class="tag-links">
    				<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    		<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    	</div>
    </div>
    <!-- // End of Post Wrap -->

    You'll see the comments_popup_link function - I'd toast that and add the comments template function:

    http://codex.wordpress.org/Function_Reference/comments_template

    <!-- NOTE: If you need to make changes to this file, copy it to your current theme's main
    	directory so your changes won't be overwritten when the plugin is upgraded. -->
    
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post">
    	<!-- This is the output of the post TITLE -->
    	<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
    	<!-- This is the output of the EXCERPT -->
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div>
    
    	<!-- This is the output of the META information -->
    	<div class="entry-utility">
    		<?php if ( count( get_the_category() ) ) : ?>
    			<span class="cat-links">
    				<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<?php
    			$tags_list = get_the_tag_list( '', ', ' );
    			if ( $tags_list ):
    		?>
    			<span class="tag-links">
    				<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<?php comments_template(); ?>
    		<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    	</div>
    </div>
    <!-- // End of Post Wrap -->

    Note - this will also embed the actual comments in the page too. Not my favorite setup, personally, but I hope that helps.

    Eric

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic