• Resolved shahramdeaf

    (@shahramdeaf)


    i would like create theme page for get recent comment, i do not want in get recent comment in siderbar….

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter shahramdeaf

    (@shahramdeaf)

    Thank you for quick reply, yes, i did read it before but i want create other file, like i add navigation only comment
    like: http://www.deafvideo.tv/category/asl?sort=comments

    Thread Starter shahramdeaf

    (@shahramdeaf)

    I want to clear… i like make new file for recent-comment.php then put navigation so people can click on navigation then see which one new comments

    Then
    1. read the above link
    2. create a new Page Template

    <?php
    /**
     * Template Name: One column Comments Page, no sidebar
     *
     * A custom page template without sidebar.
     *
     * The "Template Name:" bit above allows this to be selectable
     * from a dropdown menu on the edit page screen.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */

    3. Take what you’ve learned from the above link and add it to the new page template
    4. upload via ftp, it should show up when you 5. make a new page and choose the new Page Template
    6. Publish the page7. view the page
    8. Do whatever you do in your site to put a link to this new page in your navigation (some just show up, some use the new nav_menu, etc.)
    9. Happy blogging

    Thread Starter shahramdeaf

    (@shahramdeaf)

    local in wp-includes/recent-comment.php or themes/…/recent-comment.php

    /wp-content/themes/theme_folder/recent-comments-template.php

    Thread Starter shahramdeaf

    (@shahramdeaf)

    <?php
    /**
     * Template Name: One column Comments Page, no sidebar
     *
     * A custom page template without sidebar.
     *
     * The "Template Name:" bit above allows this to be selectable
     * from a dropdown menu on the edit page screen.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
     ?>
    
    <?php get_header(); ?>
    
    <?php
    $comments = get_comments('post_id=2');
    foreach($comments as $comm) :
    	echo($comm->comment_author);
    endforeach;
    ?>
    
    <?php get_footer(); ?>

    I add the code not work…
    check here url: http://deafiran.com/blog/recent-comments-template.php

    You created a Page Template with the above code, which means you got to about 3 or 4 of my instructions. Now do 5-9.

    Thread Starter shahramdeaf

    (@shahramdeaf)

    I did upload to root and not show up i think need add some code to functions.php or loop.php

    I did upload to root and not show up i think need add some code to functions.php or loop.php

    Ok, so you got to step 5. Have you created a new page?

    Does the new template show up as a page option?
    Image

    Have you selected this page template from the dropdown and published the page? If so, what is the url to the page you have published using the new page template?

    Thread Starter shahramdeaf

    (@shahramdeaf)

    i looking and looking can’t find it

    Thread Starter shahramdeaf

    (@shahramdeaf)

    whoa, just i found the in page so show up but not show for recent comment…
    here url: http://deafiran.com/blog/test?preview=true&preview_id=178&preview_nonce=3c4fff39bc

    or

    http://deafiran.com/blog/test

    <?php get_header(); ?>
    
    <?php
    $comments = get_comments('post_id=2');
    foreach($comments as $comm) :
    	echo($comm->comment_author);
    endforeach;
    ?>
    
    <?php get_footer(); ?>

    Read the original link. In your code, you are getting the comment & author of post_id 2, which may not exist, or may not have comments.

    Try replacing the above with the following:

    <?php get_header(); ?>
    <?php
    $args = array(
    	'status' => 'approve',
    	'number' => '5',
    );
    $comments = get_comments($args);
    foreach($comments as $comm) :
    	echo('<i>'.$comm->comment_author . '</i><br />' . $comm->comment_content .'<br/>');
    endforeach;
    ?>
    <?php get_footer(); ?>
    Thread Starter shahramdeaf

    (@shahramdeaf)

    I want say to u many many many thank you for helpful…. i would like to add thumbnail not text….

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘I want create comment template’ is closed to new replies.