• Hi,
    I’m trying to add <div> between ul list but don’t know how.
    This code do nothing:

    add_filter( 'BeRocket_AAPF_template_full_content', 'some_custom_berocket_aapf_template_full_contenteee', 4000, 3 );
    
    function some_custom_berocket_aapf_template_full_contenteee( $template_content, $terms, $berocket_query_var_title ) {
       if ( $berocket_query_var_title['new_template'] == 'checkbox' ) {
          $template_content['template']['content']['filter']['content']['list'] = berocket_insert_to_array(
             $template_content['template']['content']['filter']['content']['list'],
             'content',
             array(
                'custom_content' => '<div id="top-filter" class="top-product-filter selected">
             </div>'
             ),
             true
          );
       }
    
       return $template_content;
    }

    output should be like:

    <ul>
    <li>
    <li>
    <div></div>
    </ul>
    • This topic was modified 2 years, 7 months ago by ncti.
    • This topic was modified 2 years, 7 months ago by ncti.
Viewing 1 replies (of 1 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    berocket_insert_to_array function that add elements to array after some specific element.
    In your cause it add single element
    'custom_content' => '<div id="top-filter" class="top-product-filter selected"></div>'
    after element with key
    content
    in array
    $template_content['template']['content']['filter']['content']['list']
    But this array do not have element with key content.

    If you need to add element just to the end of <ul>, then add element to array
    $template_content['template']['content']['filter']['content']['list'][] = '<div id="top-filter" class="top-product-filter selected"></div>';

    Regards,
    Oleg

Viewing 1 replies (of 1 total)
  • The topic ‘How to add some content between’ is closed to new replies.