Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcel Pol

    (@mpol)

    Hi, there is no override for the template.

    What exactly do you want to do?

    Thread Starter tuyennv

    (@tuyennv)

    Thanks for your reply.

    I want to group span has class date-time, gb-author-origin, gb-time into one “DIV” element.

    Plugin Author Marcel Pol

    (@mpol)

    You mean without the Name part?
    Because the div.gb-author-info has those element, but also includes the Name.

    You could use a filter and a regex.
    This worked for me. You might finetune it.
    You can place it in your functions.php or in a custom plugin.

    function your_custom_function($entry) {
        // $entry is a string
        $old = '<span class="gb-author-origin">';
        $new = '<div class="yourdiv"><span class="gb-author-origin">';
    
        if ( strpos( $entry, $old) ) {
            $entry = str_replace( $old, $new, $entry );
        } else {
            $old = '<span class="gb-datetime">';
            $new = '<div class="yourdiv"><span class="gb-datetime">';
            $entry = str_replace( $old, $new, $entry );
        }
        $old = '<div class="gb-entry-content">';
        $new = '</div><div class="gb-entry-content">';
        $entry = str_replace( $old, $new, $entry );
        return $entry;
    }
    add_filter( 'gwolle_gb_entry_read', 'your_custom_function');
    Thread Starter tuyennv

    (@tuyennv)

    Marcel Pol,
    Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to override read.php in theme?’ is closed to new replies.