<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Modificare etichette form commenti a seconda del contenuto]]></title><description><![CDATA[<p dir="auto">Sicuramente dal titolo avrete capito poco o nulla...<br />
In pratica voglio trasformare una pagina in una sorta di bacheca, abilitandone i commenti.<br />
Purtroppo le etichette del form (lascia un commento, invia il tuo commento, ecc.) sono adatte agli articoli e meno a quel che occorre a me.<br />
Cercavo, quindi, il sistema per diversificarle utilizzando delle altre espressioni.<br />
L'idea che mi è venuta è stata quella di creare un nuovo template nel quale poi incorporare il comments.php<br />
Purtroppo però sostituendo a<br />
&lt;?php comments_template(); ?&gt;<br />
il contenuto del file comments.php non ottengo un errore ma scompare la visualizzazione dei commenti già inseriti.</p>
<p dir="auto">Sto sbagliando da qualche parte? E' impossibile da realizzare? Esiste qualche plugin in merito?<br />
Ditemi voi...</p>
<p dir="auto">Grazie per l'attenzione e ciao...</p>
<p dir="auto">bacheca.php</p>
<pre><code>&lt;?php
/*
Template Name: Bacheca
*/
?&gt;

&lt;?php get_header(); ?&gt;

&lt;?php if (have_posts()) : ?&gt;
  
    &lt;?php while (have_posts()) : the_post(); ?&gt;

    &lt;!-- post --&gt;
    &lt;div &lt;?php post_class('post'); ?&gt; id="post-&lt;?php the_ID(); ?&gt;"&gt;
        &lt;h1 class="post-title"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;
        &lt;div class="post-text"&gt;
        &lt;?php
        the_content(__('Read the full post','comet').' &amp;raquo;');
        wp_link_pages('before=&lt;div class="post-pages"&gt;'.__('Pages','comet').':&amp;after=&lt;/div&gt;&amp;next_or_number=number&amp;pagelink=&lt;span&gt;%&lt;/span&gt;');
        ?&gt;
        &lt;/div&gt;
        &lt;div class="post-meta"&gt;
            &lt;div class="row"&gt;
                &lt;?php if ( comments_open() ) { ?&gt;
                    &lt;div class="alignright"&gt;&lt;?php comments_popup_link(__('No Comments','comet'),__('1 Comment','comet'),__('% Comments','comet')); ?&gt;&lt;/div&gt;
                &lt;?php } ?&gt;
                &lt;?php edit_post_link(__('Edit Post','comet'), ' &amp;nbsp;&amp;bull;&amp;nbsp; ', ''); ?&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;!--/post --&gt;
    
    &lt;div class="sep"&gt;&lt;/div&gt;

    &lt;?php comments_template(); ?&gt;
        
    &lt;?php endwhile; ?&gt;

    &lt;?php else : ?&gt;

    &lt;div class="post"&gt;
        &lt;h1 class="post-title"&gt;&lt;?php _e('Page not found','comet'); ?&gt;&lt;/h1&gt;
        &lt;div class="post-text"&gt;
            &lt;p&gt;&lt;?php _e('The page you were looking for could not be found.','comet'); ?&gt;&lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;
        
&lt;?php endif; ?&gt;

&lt;?php get_footer(); ?&gt;
</code></pre>
<p dir="auto">comments.php</p>
<pre><code>&lt;!-- #comments --&gt;
&lt;div id="comments"&gt;

&lt;?php
if ( post_password_required() ) {
    
    _e('This post is password protected. Enter the password to view any comments.','comet');
    echo "&lt;/div&gt;&lt;!-- #comments --&gt;";

    return;
}

// we have comments
if ( have_comments() ) { ?&gt;
    
    &lt;a href="#respond" class="alignright leave-one"&gt;&lt;?php _e('Leave a comment','comet'); ?&gt;&lt;/a&gt;
    &lt;h3 class="comment-heading post-title"&gt;&lt;?php comments_number(__('No Comments','comet'),__('1 Comment','comet'),__( '% Comments','comet') );?&gt;&lt;/h3&gt;

    &lt;?php if ( get_comment_pages_count() &gt; 1 &amp;&amp; get_option( 'page_comments' ) ) { ?&gt;
    &lt;div class="navigation"&gt;
        &lt;?php paginate_comments_links() ?&gt;
    &lt;/div&gt;
    &lt;?php } ?&gt;

    &lt;ol class="commentlist"&gt;
        &lt;?php wp_list_comments('type=comment&amp;callback=fp_comments'); ?&gt;
    &lt;/ol&gt;

    &lt;?php if ( get_comment_pages_count() &gt; 1 &amp;&amp; get_option( 'page_comments' ) ) { ?&gt;
    &lt;div class="navigation"&gt;
        &lt;?php paginate_comments_links() ?&gt;
    &lt;/div&gt;
    &lt;?php } ?&gt;

    &lt;ol class="trackbacklist"&gt;
        &lt;?php wp_list_comments('type=pingback&amp;callback=fp_trackbacks'); ?&gt;
    &lt;/ol&gt;

&lt;?php
// we dont have comments
} else {
    
    // comments are closed
    if ( ! comments_open() &amp;&amp; ! is_page() ) {

        _e('Comments are closed.','comet');
        
    }

}


// comment form
if ( function_exists('comment_form') ) {
    
    comment_form();
    
} else { // using WordPress lower than 3.0

    if ('open' == $post-&gt;comment_status) { ?&gt;

        &lt;h2 class="comment-heading post-title"&gt;&lt;?php comment_form_title(); ?&gt;&lt;/h2&gt;
    
        &lt;div id="respond"&gt;
    
        &lt;?php if ( get_option('comment_registration') &amp;&amp; !$user_ID ) { ?&gt;
    
            &lt;p&gt;You must be &lt;a href="&lt;?php echo get_option('siteurl'); ?&gt;/wp-login.php?redirect_to=&lt;?php echo urlencode(get_permalink()); ?&gt;"&gt;logged in&lt;/a&gt; to post a comment.&lt;/p&gt;
    
        &lt;?php } else { ?&gt;
    
            &lt;form action="&lt;?php echo get_option('siteurl'); ?&gt;/wp-comments-post.php" method="post" id="commentform"&gt;
    
            &lt;div class="cancel-comment-reply"&gt;
                &lt;p&gt;&lt;?php cancel_comment_reply_link(); ?&gt;&lt;/p&gt;
            &lt;/div&gt;
        
            &lt;?php if ( $user_ID ) { ?&gt;
    
                &lt;p&gt;Logged in as &lt;a href="&lt;?php echo get_option('siteurl'); ?&gt;/wp-admin/profile.php"&gt;&lt;?php echo $user_identity; ?&gt;&lt;/a&gt;&lt;/p&gt;
                &lt;p&gt;&lt;a href="&lt;?php echo wp_logout_url(get_permalink()); ?&gt;" title="Log out of this account"&gt;Log out &amp;raquo;&lt;/a&gt;&lt;/p&gt;
    
            &lt;?php } else { ?&gt;
            
                &lt;p class="comment-form-author"&gt;
                    &lt;label for="author"&gt;Name&lt;/label&gt;
                    &lt;span class="required"&gt;*&lt;/span&gt;
                    &lt;input id="author" name="author" type="text" value="&lt;?php echo $comment_author; ?&gt;" size="30" &lt;?php if ($req) echo "aria-required='true'"; ?&gt; /&gt;
                &lt;/p&gt; 
                &lt;p class="comment-form-email"&gt;
                    &lt;label for="email"&gt;Email&lt;/label&gt;
                    &lt;span class="required"&gt;*&lt;/span&gt;
                    &lt;input id="email" name="email" type="text" value="&lt;?php echo $comment_author_email; ?&gt;" size="30" &lt;?php if ($req) echo "aria-required='true'"; ?&gt; /&gt;
                &lt;/p&gt; 
                &lt;p class="comment-form-url"&gt;
                    &lt;label for="url"&gt;Website&lt;/label&gt;
                    &lt;input id="url" name="url" type="text" value="&lt;?php echo $comment_author_url; ?&gt;" size="30" /&gt;
                &lt;/p&gt; 
        
            &lt;?php } ?&gt;
            
            &lt;p class="comment-form-comment"&gt;
                &lt;label for="comment"&gt;Comment&lt;/label&gt;
                &lt;textarea id="comment" name="comment" cols="45" rows="8"&gt;&lt;/textarea&gt;
            &lt;/p&gt;
            
            &lt;p class="form-allowed-tags"&gt;
                You may use these &lt;abbr title="HyperText Markup Language"&gt;HTML&lt;/abbr&gt; tags and attributes:  &lt;code&gt;&amp;lt;a href=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot;&amp;gt; &amp;lt;abbr title=&amp;quot;&amp;quot;&amp;gt; &amp;lt;acronym title=&amp;quot;&amp;quot;&amp;gt; &amp;lt;b&amp;gt; &amp;lt;blockquote cite=&amp;quot;&amp;quot;&amp;gt; &amp;lt;cite&amp;gt; &amp;lt;code&amp;gt; &amp;lt;del datetime=&amp;quot;&amp;quot;&amp;gt; &amp;lt;em&amp;gt; &amp;lt;i&amp;gt; &amp;lt;q cite=&amp;quot;&amp;quot;&amp;gt; &amp;lt;strike&amp;gt; &amp;lt;strong&amp;gt; &lt;/code&gt;
            &lt;/p&gt;
            &lt;p class="form-submit"&gt; 
                &lt;input name="submit" type="submit" id="submit" value="Post Comment" /&gt; 
                &lt;?php comment_id_fields(); ?&gt;
            &lt;/p&gt; 
    
            &lt;?php do_action('comment_form', $post-&gt;ID); ?&gt;
    
            &lt;/form&gt;&lt;!-- /commentform --&gt;
    
        &lt;?php } // If registration required and not logged in ?&gt;
        &lt;/div&gt;&lt;!-- /respond --&gt;
        
&lt;?php
    }

} // if you delete this the sky will fall on your head ?&gt;

&lt;/div&gt;&lt;!-- #comments --&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/154331/modificare-etichette-form-commenti-a-seconda-del-contenuto</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 02:29:17 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/154331.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 01 Jul 2011 12:05:47 GMT</pubDate><ttl>60</ttl></channel></rss>