Wordpress auto expand komentara

Tražim auto expand komentara za wordpress.
Našao sam ovo

ali uputa traži da se nađe neki redak kojeg nemam u mojem index.php-u

Moj index.php (fusion template)

<span class="syntaxhtml"><span class="syntaxdefault"><?php<br />&nbsp;</span><span class="syntaxcomment">/*&nbsp;Fusion/digitalnature&nbsp;*/<br />&nbsp;</span><span class="syntaxdefault">get_header</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">?><br /><?php&nbsp;$withcomments&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">1&nbsp;?><br /></span><!--&nbsp;mid&nbsp;content&nbsp;--><br /><div&nbsp;id="mid-content"><br /><span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">if&nbsp;(</span><span class="syntaxdefault">have_posts</span><span class="syntaxkeyword">())&nbsp;:&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">while&nbsp;(</span><span class="syntaxdefault">have_posts</span><span class="syntaxkeyword">())&nbsp;:&nbsp;</span><span class="syntaxdefault">the_post</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<!--&nbsp;post&nbsp;--><br />&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;id="post-<span class="syntaxdefault"><?php&nbsp;the_ID</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?></span>"&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">if&nbsp;(</span><span class="syntaxdefault">function_exists</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"post_class"</span><span class="syntaxkeyword">))&nbsp;</span><span class="syntaxdefault">post_class</span><span class="syntaxkeyword">();&nbsp;else&nbsp;print&nbsp;</span><span class="syntaxstring">'class="post"'</span><span class="syntaxkeyword">;&nbsp;</span><span class="syntaxdefault">?></span>><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h3&nbsp;class="title"><a&nbsp;href="<span class="syntaxdefault"><?php&nbsp;the_permalink</span><span class="syntaxkeyword">()&nbsp;</span><span class="syntaxdefault">?></span>"&nbsp;rel="bookmark"&nbsp;title="<span class="syntaxdefault"><?php&nbsp;_e</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Permanent&nbsp;Link:'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">);&nbsp;echo&nbsp;</span><span class="syntaxstring">'&nbsp;'</span><span class="syntaxkeyword">;&nbsp;</span><span class="syntaxdefault">the_title_attribute</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?></span>"><span class="syntaxdefault"><?php&nbsp;the_title</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?></span></a></h3><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--&nbsp;story&nbsp;header&nbsp;--><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="postheader"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="postinfo"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p><span class="syntaxdefault"><?php&nbsp;printf</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Posted&nbsp;by&nbsp;%s&nbsp;in&nbsp;%s&nbsp;on&nbsp;%s'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">),</span><span class="syntaxstring">'<a&nbsp;href="'</span><span class="syntaxkeyword">.&nbsp;</span><span class="syntaxdefault">get_author_posts_url</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">get_the_author_ID</span><span class="syntaxkeyword">())&nbsp;.</span><span class="syntaxstring">'"&nbsp;title="'</span><span class="syntaxkeyword">.&nbsp;</span><span class="syntaxdefault">sprintf</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Posts&nbsp;by&nbsp;%s"</span><span class="syntaxkeyword">,</span><span class="syntaxstring">"fusion"</span><span class="syntaxkeyword">),&nbsp;</span><span class="syntaxdefault">attribute_escape</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">get_the_author</span><span class="syntaxkeyword">())).</span><span class="syntaxstring">'&nbsp;">'</span><span class="syntaxkeyword">.&nbsp;</span><span class="syntaxdefault">get_the_author</span><span class="syntaxkeyword">()&nbsp;.</span><span class="syntaxstring">'</a>'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">get_the_category_list</span><span class="syntaxkeyword">(</span><span class="syntaxstring">',&nbsp;'</span><span class="syntaxkeyword">),&nbsp;</span><span class="syntaxdefault">get_the_time</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">get_option</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'date_format'</span><span class="syntaxkeyword">)));&nbsp;</span><span class="syntaxdefault">?></span>&nbsp;<span class="syntaxdefault"><?php&nbsp;edit_post_link</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Edit'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">),</span><span class="syntaxstring">'|&nbsp;'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">''</span><span class="syntaxkeyword">);&nbsp;</span><span class="syntaxdefault">?></span></p><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--&nbsp;/story&nbsp;header&nbsp;--><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="postbody&nbsp;entry&nbsp;clearfix"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">if(</span><span class="syntaxdefault">get_option</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'fusion_indexposts'</span><span class="syntaxkeyword">)==</span><span class="syntaxstring">'excerpt'</span><span class="syntaxkeyword">)&nbsp;</span><span class="syntaxdefault">the_excerpt</span><span class="syntaxkeyword">();&nbsp;else&nbsp;</span><span class="syntaxdefault">the_content</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Read&nbsp;the&nbsp;rest&nbsp;of&nbsp;this&nbsp;entry&nbsp;&raquo;'</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">));&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$posttags&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">get_the_tags</span><span class="syntaxkeyword">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span class="syntaxdefault">$posttags</span><span class="syntaxkeyword">)&nbsp;{&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p&nbsp;class="tags"><span class="syntaxdefault"><?php&nbsp;the_tags</span><span class="syntaxkeyword">(</span><span class="syntaxstring">''</span><span class="syntaxkeyword">);&nbsp;</span><span class="syntaxdefault">?></span></p><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">}&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p&nbsp;class="postcontrols"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">global&nbsp;</span><span class="syntaxdefault">$id</span><span class="syntaxkeyword">,&nbsp;</span><span class="syntaxdefault">$comment</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">$number&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">get_comments_number</span><span class="syntaxkeyword">(&nbsp;</span><span class="syntaxdefault">$id&nbsp;</span><span class="syntaxkeyword">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a&nbsp;class="<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">if(</span><span class="syntaxdefault">$number</span><span class="syntaxkeyword"><</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">)&nbsp;{&nbsp;echo&nbsp;</span><span class="syntaxstring">'no&nbsp;'</span><span class="syntaxkeyword">;&nbsp;}</span><span class="syntaxdefault">?></span>comments"&nbsp;href="<span class="syntaxdefault"><?php&nbsp;comments_link</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?></span>"><span class="syntaxdefault"><?php&nbsp;comments_number</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'No&nbsp;Comments'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">),&nbsp;</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'1&nbsp;Comment'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">),&nbsp;</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'%&nbsp;Comments'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">));&nbsp;</span><span class="syntaxdefault">?></span></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="clear"></div><br />&nbsp;&nbsp;&nbsp;&nbsp;</div><br />&nbsp;&nbsp;&nbsp;&nbsp;<!--&nbsp;/post&nbsp;--><br />&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">endwhile;&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="navigation"&nbsp;id="pagenavi"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">if(</span><span class="syntaxdefault">function_exists</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'wp_pagenavi'</span><span class="syntaxkeyword">))&nbsp;:&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;wp_pagenavi</span><span class="syntaxkeyword">()&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">else&nbsp;:&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="alignleft"><span class="syntaxdefault"><?php&nbsp;next_posts_link</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'&laquo;&nbsp;Older&nbsp;Entries'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">))&nbsp;</span><span class="syntaxdefault">?></span></div><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="alignright"><span class="syntaxdefault"><?php&nbsp;previous_posts_link</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Newer&nbsp;Entries&nbsp;&raquo;'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'fusion'</span><span class="syntaxkeyword">))&nbsp;</span><span class="syntaxdefault">?></span></div><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div&nbsp;class="clear"></div><br />&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">endif;&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;</div><br />&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">else&nbsp;:&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;<h2><span class="syntaxdefault"><?php&nbsp;_e</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Not&nbsp;Found"</span><span class="syntaxkeyword">,</span><span class="syntaxstring">"fusion"</span><span class="syntaxkeyword">);&nbsp;</span><span class="syntaxdefault">?></span></h2><br />&nbsp;&nbsp;&nbsp;&nbsp;<p&nbsp;class="error"><span class="syntaxdefault"><?php&nbsp;_e</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Sorry,&nbsp;but&nbsp;you&nbsp;are&nbsp;looking&nbsp;for&nbsp;something&nbsp;that&nbsp;isn't&nbsp;here."</span><span class="syntaxkeyword">,</span><span class="syntaxstring">"fusion"</span><span class="syntaxkeyword">);&nbsp;</span><span class="syntaxdefault">?></span></p><br />&nbsp;&nbsp;&nbsp;&nbsp;<span class="syntaxdefault"><?php&nbsp;get_search_form</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?><br /></span>&nbsp;<span class="syntaxdefault"><?php&nbsp;</span><span class="syntaxkeyword">endif;&nbsp;</span><span class="syntaxdefault">?><br /></span></div><br /><!--&nbsp;mid&nbsp;content&nbsp;--><br /></div><br /><!--&nbsp;/mid&nbsp;--><br /><br /><span class="syntaxdefault"><?php&nbsp;get_sidebar</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?><br /></span><br /><span class="syntaxdefault"><?php&nbsp;get_footer</span><span class="syntaxkeyword">();&nbsp;</span><span class="syntaxdefault">?><br /></span><br /></span>

O PHP-u nemam blage veze :frowning:

Kak se ovo iz privitka ponasa, jer to to?

Greška se javlja…

Parse error: syntax error, unexpected T_ELSE in /home/losevije/public_html/wordpress/wp-content/themes/fusion/index.php on line 53

Hvala na trudu ali ne moraš se zezati s time jer nije baš tako jednostavno. Da je, već bi svi imali to riješeno. :slight_smile:

probaj ima dve mogucnosti.
ili ostavi sada kako je ali izbaci iz 53 <?php else : ?>

ili sta je vjerojatnije

red 42 43

<?php comments_template(); ?> <?php endwhile;?>

znaci bez else: u <?php endwhile; else:?>

Nekad prije sam se za dosta foruma igrao sa modanjem i kodiranjem tako da se neceg jos sjecam :slight_smile:

Definitivno je napredak. :slight_smile:

  • sada se komentari vide samo na prvom postu, ja bi da se vide svugdje
  • na prvom postu postoji forma za unos, ako može da se makne ako ne nije bed

Evo i link, da bude lakše:
http://www.lose-vijesti.com

a koja od ove dve mogucnosti gore je funkcionirala, pretpostavljam ova druga, probaj sljedece:
prebaci red 42 i 43 ispred reda 52 znaci da izgleda:

51<?php comments_template(); ?>
52<?php endwhile;?>
53<?php else : ?>

ili
51 <?php comments_template(); ?>
52 <?php endwhile; else : ?>

Sta se dogadja kad ovdje stavis neki drugi broj osim 1

<?php $withcomments = 1 ?>

Poz

Tnx,

malo sam pročačkao oko tih funkcija i za sada ne dobijam ono što hoću pa sam sve maknuo. Budem još malo to proučio, PHP ali i sam WP se čine zanimljivim.


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja