Modify “the_content” Function’s formatting
-
I’m using WP for a traditional website and have written an events page using a custom query. The query pulls out all pages that have a “calendar” custom field providing me with event titles and event dates. I want to format the output like this:
March 23, 2008
Town Hall MeetingThe text would be plain and not bolded. There would be no more tag as in my current output.
At this time, I’m making due with the output of “the_content” function but can’t figure out how to modify the output to my liking.
The page is:
https://test2.handcraftedsites.com/calendar.phpHere’s my code:
$querystr =" SELECT $wpdb->posts.* FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) WHERE $wpdb->postmeta.meta_key = 'calendar' AND $wpdb->posts.post_status = 'publish' AND $wpdb->postmeta.meta_value = 'yes' ORDER BY $wpdb->posts.menu_order ASC"; $pageposts = $wpdb->get_results($querystr, OBJECT); if ($pageposts): ?> <?php foreach ($pageposts as $post): ?> //in here is some year and month formatting but this is //simply for displaying year and month titles and doesn't //have anything to do with displaying each page. setup_postdata($post); ?> <?php the_title(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_content() ?></a> // more month and year code here <?php endforeach; ?> <?php else : ?> <strong>Please check back for calendar listings!</strong> <?php endif; ?>
I guess I need to be able to get into the “guts” of the “the_content” function unless there is code provided already that exposes the functionality I need.
Thank you for your help!
Codecottage
- The topic ‘Modify “the_content” Function’s formatting’ is closed to new replies.