Skip to:
Content
Pages
Categories
Search
Top
Bottom

topic loop with searchcriteria


  • ChrissiLisa
    Participant

    @chrissilisa

    Hello,

    how can I add search-criteria to

    while ( bbp_topics() ) : bbp_the_topic();

    for example

    get_post_meta( bbp_get_topic_id(), ‘ort’, true) == ‘Berlin’ ?

    (I added a searchfield in loop-topics.php).

Viewing 1 replies (of 1 total)

  • ChrissiLisa
    Participant

    @chrissilisa

    i found this solution:

    <li class=”bbp-body”>
    
    <?php while ( bbp_topics() ) : bbp_the_topic();
    
    if(isset($_GET[‘submit’]) && !empty($_GET[‘ort’])){
    
    $ort = get_post_meta( bbp_get_topic_id(), ‘ort’,true);
    
    if($ort==$_GET[‘ort’]){
    
    //do_action( ‘bbp_template_before_topics_loop’ );
    bbp_get_template_part( ‘loop’, ‘single-topic’ );
    
    }
    
    }
    
    else{
    do_action( ‘bbp_template_before_topics_loop’ );
    bbp_get_template_part( ‘loop’, ‘single-topic’ );
    
    }
    
    endwhile; ?>

    The problmem is, that when I have 2 results the 2 topic are broken to 2 pages (I see an pagination für evtry topic) – how can I avoid this ?

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