S
S
sashavol2015-10-18 18:55:32
WordPress
sashavol, 2015-10-18 18:55:32

List news in sidebar (wordpress)?

Hello everyone, I'm trying to display a list of news in the sidebar. I put a normal function with parameters:

get_posts(options)

I deduce with the filter on headings, quantity.
They are displayed perfectly, but the title the_title() changes the title of breadcrumbs for me, that is, they are more priority than current news, articles.
Maybe the the_title() function has an analogue? To not be so global

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Golubev, 2015-10-18
@sashavol

You need a more detailed code, probably in your first loop the headers are entered into a variable, and then displayed, for example:

$title = the_title() ;
echo '<h2>'.$title.'</h2>';

Then in the next loop, if you do not set this variable again, you will have the old title.

M
Mr Crabbz, 2015-10-18
@Punkie

After your function (after the loop), add:
Must reset the loop, as a result of which your breadcrumbs will have to take the title from the main loop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question