A
A
Alexey Chernov2016-04-24 16:46:10
CMS
Alexey Chernov, 2016-04-24 16:46:10

How to display a link to the latest post from a specific category?

How to display a link to the latest post from a specific category?
NO CYCLE
Thank you :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bro-dev, 2016-04-24
@xPomaHx

$p=get_posts( array(
  'numberposts'     => 1,
  'category'        => '1',
  'orderby'         => 'post_date',))[0]

I did not delve into it, but most likely there is a cycle inside. Any selection from an array, no matter what, is an enumeration, which means a cycle.

A
aarty20, 2016-04-26
@aarty20

I don’t know why the cycle didn’t please you, but through it your task is very conveniently and quickly completed. as many as 2 arguments to set for vp_query - and you're done;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question