Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Different template for most recent post?

$
0
0

Replies: 0

Scenario: I have a CPT called “Market Reports.”

I want the most recently published Market Report to use is_user_logged_in to only show to logged in users. Non-logged-in uses are displayed a login form. Logged-in users are shown the post content.

I know I can do this manually by simply creating two different single.php templates and changing them when I create a new post.

However, is there any way to use some code in the template to check if there is a more recent market report post and do this dynamically?


Viewing all articles
Browse latest Browse all 59525

Trending Articles