• Есть 2 элемента например дата и автор как сделать чтобы дата была на новой строчке ?
    Вот кусок кода , echo ‘<br />’; и echo «\n»; не работают почемуто!!
    function ap_question_metas( $question_id = false ) {
    if ( false === $question_id ) {
    $question_id = get_the_ID();
    }

    $metas = array();

    // If featured question.
    if ( ap_is_featured_question( $question_id ) ) {
    $metas[‘featured’] = __( ‘Featured’, ‘anspress-question-answer’ );
    }

    if ( is_question() ) {
    $last_active = ap_get_last_active( get_question_id() );
    $metas[‘active’] = » . $last_active . ‘
    ‘;
    }

    if ( ! is_question() ) {
    $metas[‘history’] = » . ap_recent_activity( $question_id, false );
    }

    echo ‘<br/>’;

    if ( ap_have_answer_selected() ) {
    $metas[‘solved’] = » . __( ‘Solved’, ‘anspress-question-answer’ ) . ‘
    ‘;
    }

    $view_count = ap_get_post_field( ‘views’ );
    $metas[‘views’] = » . sprintf( __( ‘%d views’, ‘anspress-question-answer’ ), $view_count ) . »;

    /**
    * Used to filter question display meta.
    *
    * @param array $metas
    */
    $metas = apply_filters( ‘ap_display_question_metas’, $metas, $question_id );

    $output = »;
    if ( ! empty( $metas ) && is_array( $metas ) ) {
    foreach ( $metas as $meta => $display ) {
    $output .= «{$display}»;
    }
    }

    echo $output; // xss ok.
    }

  • Тема «Как сделать чтобы второй элемент был на новой строке!?» закрыта для новых ответов.