philowen
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Page update date in a foreach loop?Thanks alchymyth, but I got it! Figured out a much simpler way to accomplish what I was trying to do. The query function allows the modified date to be used in the “orderby” parameter.
Code at https://pastebin.com/BJJSvn9A
See it in action (needs a little styling) at https://walkthurston.info/page-activity/
That’s my first custom query/loop. Not bad for a noob, eh?
Forum: Themes and Templates
In reply to: Page update date in a foreach loop?Thanks alchymyth, but this doesn’t seem to do it.
Here’s my complete code, with the setup_postdata function call included:
EDIT: Providing a pastbin link instead of code after reviewing forum welcome/etiquette page: https://pastebin.com/WWwXjCYH
The above code produces this kind of format:
Recently Commented Pages by philowen on No Comments
Page Activity by philowen on No Comments
Opportunities by on No Comments
Resources by on No Comments
Training by on No Commentsthe_modified_time and the_excerpt function calls still don’t work. Could it have something to do with the foreach loop being wrapped in an “if” statement?
Forum: Themes and Templates
In reply to: Page update date in a foreach loop?I’ve also tried some other date type functions, including the_time(), but it seems none of these will work. Any ideas?
Forum: Fixing WordPress
In reply to: Trouble with displaying Post DatesAlso tried using the_modified_time and just the_time. None of them will show.
Forum: Fixing WordPress
In reply to: Trouble with displaying Post DatesI’m having a very similar problem with posting the modified date – using the_modified_date instead of the_time.
Were you able to figure out a solution?
Forum: Themes and Templates
In reply to: Page update date in a foreach loop?oops, looks like the pastebin thing didn’t work.
Try again:
foreach ($recentposts as $post) { if ($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID); echo " <li><a>ID)."'>"; the_title(); echo '</a>'; echo ' was modified by '; the_modified_author(); echo ' on '; the_modified_date(); comments_number(); echo '</li> '; }