Поддержка Проблемы и решения вывод строки над записью

  • Здравствуйте, нужно вывести строку get_field(‘news_update’) над новостью.
    чтобы она не прописывалась в текст новости
    подскажите, как это сделать

    function the_recontent($content){
    $posts = get_field('news_update');
    if($_SERVER['SCRIPT_NAME'] !== '/feed.php')
    if ($posts) {
    $text = '<div class="textMUpdate"> <div class="textMUpdate_title">Обновление:</div>';
    foreach($posts as $post) { $text .= '<a href="' . get_the_permalink($post->ID) . '">' . $post->post_title . '</a><br/>';}
    $content = $text . '</div>' . $content;
    } 
    
    $posts = get_field('facts');
    if($_SERVER['SCRIPT_NAME'] !== '/feed.php')
    if ($posts) {
    $text = '<div> <div class="factstitle"><p class="factstitle">ФАКТЫ</p></div>';
    foreach($posts as $post) { $text2 .= '<div class="factsbox"><ul>' . '<li><input type="checkbox" checked> <i></i>' . '<h2>' . $post->post_title  . '</h2>' . '<p>' . $post->post_content . '</p>' . '</li></ul></div>';}
    $content =  $content . $text . $text2 .'</div>';
    }
  • Тема «вывод строки над записью» закрыта для новых ответов.