Answer the question
In order to leave comments, you need to log in
How to create a news page in WordPress?
Good day to all!
I recently started doing layout and took an order to create a website.
I ran into a problem with displaying a news block on a page using WordPress. I have a ready-made layout for design, I have already made a theme out of this layout, created an adaptive menu, everything works very well, but I can’t implement the news block, especially so that the news looks the same as in the design.
Here's what they should look like:
And here's what I get:
And at the same time, if you follow the link to the article, the text and photo that I inserted when creating the post (news) are not displayed:
Please tell me how to create a news block correctly, what and in which file to register in the folder with my theme, so that everything works as it should and the client can add new news, otherwise I have already rummaged through half the Internet, but I can’t make it out properly, because I don’t I understand php.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
To get started, you should familiarize yourself with the template hierarchy . The single.php template is responsible for displaying the post, and archive.php
is responsible for displaying the archive page . or taxonomy.php
For the front page, you should use front-page.php , home.php , or custom if the front page is created using a static page. In index.php - the base cycle
Immediately I advise you to read about the functions wp_query()
andget_terms()
, they are needed to query records and terms from the database for further processing or output.
For output, you need functions of the following form:
the_title()
- display titlethe_post_thumbnail()
- display the image of the recordthe_content()
- display contentDidn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question