Skip to:
Content
Pages
Categories
Search
Top
Bottom

How add Class on list


  • puniler
    Participant

    @puniler

    Hi,

    I want to add Class on “★” by PHP template.

    <ul id="topic-<?php bbp_topic_id(); ?>-replies" class="forums bbp-replies">
    
    	<li class="bbp-header">
    		<!-- various -->
    	</li>
    
    	<li class="bbp-body"></li>
    		
    	<li class="★">
    		<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    			<div class="bbp-meta">
    				<!-- various -->
    			</div>
    		</div>
    		<div <?php bbp_reply_class(); ?>>
    			<!-- various -->
    		</div>
    	</li>
    	
    	<li class="★">
    		<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    			<div class="bbp-meta">
    				<!-- various -->
    			</div>
    		</div>
    		<div <?php bbp_reply_class(); ?>>
    			<!-- various -->
    		</div>
    	</li>	
    
    	<li class="bbp-footer">
    		<!-- various -->
    	</li>
    
    </ul>

    But I do not know the appropriate PHP template.
    I wonder what I should do.
    Thank you.

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

  • Robin W
    Moderator

    @robin-w

    so where did this code come from ?


    puniler
    Participant

    @puniler

    Thanks for getting back to me.

    Break down the code in question into three.

    (1)
    I found the following code in this directory,
    wp-content/plugins/bbpress/templates/default/bbpress/loop-replies.php

    <ul id="topic-<?php bbp_topic_id(); ?>-replies" class="forums bbp-replies">
    
    	<li class="bbp-header">
    		<!-- various -->
    	</li>
    
    	<li class="bbp-body">
    		<?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    	</li>
    		
    	<li class="bbp-footer">
    		<!-- various -->
    	</li>
    
    </ul>

    (2)
    And the template called in the above code is below.
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.php

    	
    		<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    			<div class="bbp-meta">
    				<!-- various -->
    			</div>
    		</div>
    		<div <?php bbp_reply_class(); ?>>
    			<!-- various -->
    		</div>
    		
    		<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    			<div class="bbp-meta">
    				<!-- various -->
    			</div>
    		</div>
    		<div <?php bbp_reply_class(); ?>>
    			<!-- various -->
    		</div>	

    (3)
    But I could not find the code for the part of the list below.

    	<li class="★">
    
    	</li>
    
    	<li class="★">
    
    	</li>

    In the output HTML, this list is included, but the PHP template does not show the part of the list.

    Where is the list, how can I rewrite it?

    Thanks.


    Robin W
    Moderator

    @robin-w

    so are you trying to make a new template or what are you trying to do?


    puniler
    Participant

    @puniler

    I am trying to implement the infinite loader on the reply page.

    That’s the plug-in for that:
    Ajax Pagination and Infinite Scroll
    https://wordpress.org/plugins/malinky-ajax-pagination/

    And to use this plugin I need to add ClassName to the list, but I do not know where the list is added.

    Regardless of where I look in the template, I can not find any additional code for the list.

    I would like to find the additional part of the list and add it a ClassName.


    puniler
    Participant

    @puniler

    My purpose is this. I want to find a code adding a list and add a ClassName.

    Why does the list add to HTML, even though there is no code to add a list to both “loop-replies.php” and “loop-single-reply.php”?

    By the way, what I wrote as “list” so far is “<li></li>“.


    puniler
    Participant

    @puniler

    Sorry, I will re-ask the question.

    Why is this code on the “loop-single-reply.php” enclosed in <li></li>?

    ↓loop-single-reply.php

    <div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
        <!--various-->
    </div><!-- #post-<?php bbp_reply_id(); ?> -->
    
    <div <?php bbp_reply_class(); ?>>
        <!--various-->
    </div><!-- .reply -->

    ↓HTML

    <li>
    <div id="post-777" class="bbp-reply-header">
        <!--various-->
    </div><!-- #post-777 -->
    
    <div class="even bbp-parent-forum-212 bbp-parent-topic-383 bbp-reply-position-17 user-id-5 post-439 reply type-reply status-publish">
        <!--various-->
    </div><!-- .reply -->
    </li>

    Where is the code to add the <li></li>?
    I want to rewrite it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar