Hi Leo,
Did you create a custom single page template? That should have the announcement titles at the top of the page.
If you use the WordPress function the_title(); it should display the title of the current announcement. Depending on your theme, the styles and classes may be different. If you look at another post on your site (or a page) you should be able to get the correct HTML elements and classes from there.
Any chance you can share a link to your site? Maybe I can help out.
Thanks!
Evan
Thanks for the quick response, Evan.
I’m using the single-timeline-express-content.php template you’ve provided, and with the exception of suppressing the announcement date, I’ve left it alone.
Today, in trying to get the title at the top of the post, I’ve inserted the_title() function just before the_content, and it indeed put an unformatted text version of the_title() at the top of the post.
I was just about to dig into reading how to format the_title() results inside the template php when you wrote back.
The post I’m playing around with is: http://www.phaseiidesign.com/announcement/wrote-the-book-on-presumptive-design/
Now – I’m not quite using TE in its originally intended form – as it turns out, it makes for an excellent Portfolio display system.
With the exception of some minor tweaking (like removing the announcement date), putting the title at the top of the post,
and, my last need: allowing visitors to jump to the next/prior entry, which if you have a hint or two, I’d appreciate it.
Thanks hugely!
Leo
Okay.
I hacked my way through the single-timeline-express-content.php template to get the title at the top of the announcement. No doubt there’s a better way of doing it than this – I’m all ears – as I’m really just burrowing my way into trouble:
<?php
/* Action hook to display content before the single announcement content */
do_action( 'timeline-express-single-before-content' );
?>
/* added the title to the top of each post, with h1 formatting 8/11/2016 */
<h1><?php the_title(); ?> </h1>
/* back to the template's regularly scheduled function */
<?php
the_content();
/* Action hook to display content before the single announcement content */
do_action( 'timeline-express-single-after-content' );
?>
But now I really would like to know how to show a link to the prior/next announcement – if you could.
Thanks!
Leo
Hi Leo,
That does look to be correct. That’s how you would wrap your title with an <h1>
tag. If you really wanted to stick to how WordPress core does things, you would do the following:
<?php the_title( '<h1>', '</h1>' ); ?>
The first parameter is what is added before the title, and the second is what is added after.
In terms of adding a prior/next announcement, I’m not sure of the best way to do that. I know WordPress has a built in method for displaying post navigation, but the problem would be that the next and previous announcements (using the navigation) would be based on the date of creation, and not the ‘announcement date’ field. So clicking ‘next’ would bring you to a different announcement than what is shown on the timeline.
I will take a look and see what sort of alterations need to be made to the query to make sure that the next and previous links work properly, and then I may build in a helper function to display those links.
I will keep you posted!
Evan
Thanks Evan.
It’s not an emergency. I can manually add the links to each post, as this is a constrained set of announcements. But if it’s something that looks not to difficult to implement, I suppose others could take advantage of horizontal nav from within the announcement itself.
BTW, if you could take a look at your tutorial on editing the single-content template, I think it may be terminating prematurely. At least, that’s the way it feels to me.
Thanks again – you’ve been amazingly responsive.