Answer the question
In order to leave comments, you need to log in
How to split post content output?
Good evening everyone. Help to implement:
The post is divided into parts.
1. Object (image, video, gif, etc.)
2. MORE tag
3. div - which contains the text of the post.
The conclusion is needed: On the left is the picture, and on the right is the text
Like this:
<style>
.item-object { float: left; }
.item-text { float: right; }
</style>
<div class="item-content">
<div class="item-object">Объект (картинка видео итд)</div>
<div class="item-text">Техт</div>
</div>
Answer the question
In order to leave comments, you need to log in
In WordPress, by default, posts have the following fields and functions to display them:
<?php
echo get_the_title();//Вывести заголовок
echo apply_filters( 'the_content', get_the_content() );//форматированый вывод текстовой области. Т.е. вместе с тегами из редактора.
echo get_the_excerpt();//Вывод цитаты
echo get_post_meta( get_the_ID(), 'поле', true );//Вывод произвольного поля с именем 'поле'
$thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'thumbnail-size', true );
echo $thumb_url[0];//Вывод url прикрипленной миниатюры размером thumbnail-size
echo get_permalink();//Вывод ссылки на пост
echo get_the_date( 'Y' );//Вывод даты(года).
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question