WordPress.org

Ready to get started?Download WordPress

Forums

How to add a "Comment" button (5 posts)

  1. Aixa
    Member
    Posted 4 years ago #

    Hi, I'm kind of new to WordPress and I'd like to know if there's actually a way to put a "Comment" button/link in each post on the front page, since the comment box only appears when you are watching the single post.

    I don't know if it depends on the Theme, I'm using Arras, just in case..

    Well, here you have the link to my blog, I'd like to have the button on the "New Posts"

    Thanks in advance! (And I apologize for my bad english)

  2. Vinicius Massuchetto
    Member
    Posted 4 years ago #

    Hi Aixa.

    Yes, this depends of the theme you're using. You'll need to add some comment functions inside the_loop.

    You'll probably looking for comments_popup_link.
    http://codex.wordpress.org/Template_Tags/comments_popup_link

  3. Aixa
    Member
    Posted 4 years ago #

    Thank you so much for your quick response, yes that's exactly what I was looking for!

    But I've been trying and seems like I can't manage to place the code correctly..
    I thought it should be in home.php (since index.php is empty) somewhere between <!-- News Articles --> and <!-- #index-news -->

    <!-- News Articles -->
    <div id="index-news">
    <div class="home-title"><?php echo arras_get_option('news_title') ?></div>
    
    <?php
    $news_query_args = array(
    	'cat' => arras_get_option('news_cat'),
    	'paged' => $paged,
    	'showposts' => ( (arras_get_option('index_count') == 0 ? get_option('posts_per_page') : arras_get_option('index_count')) )
    );
    
    query_posts($news_query_args);
    arras_render_posts(null, arras_get_option('news_display'), 'news');
     ?>
    
    <?php if(function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    	<div class="navigation clearfix">
    		<div class="floatleft"><?php next_posts_link( __('Older Entries', 'arras') ) ?></div>
    		<div class="floatright"><?php previous_posts_link( __('Newer Entries', 'arras') ) ?></div>
    	</div>
    <?php } ?>
    </div><!-- #index-news -->

    But either if I put it above or below the first script, the link doesn't appear inside the post but above or below all the posts, all the links together.. I can't find the way to put it inside the posts..

    <small>I just noticed I forgot to link to my page by the way</small>

  4. Vinicius Massuchetto
    Member
    Posted 4 years ago #

    arras_render_posts is probably a built-in function of the theme that list the posts you want to put the comment link on. That's even harder to see how the theme works like this.

    Look where this function is declared, something like function arras_render_posts, so you can find where the_loop [1] is around there.

    Hope it helps. =D

    [1] http://codex.wordpress.org/The_Loop

  5. Aixa
    Member
    Posted 4 years ago #

    Oh I see, well I'll look for it until I find it!

    Thank you again! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags