Get latest blog content for page-template
-
Fairly new to WP so bear with me if you can.
I am building a custom theme for a friends band. The Front Page is a static page (called “home”) with a custom page-template (callled “home-page.php”).
I am using another static page (called “blog”) with a separate page-template I made (called “blog-page.php”). I made this “blog” page the post page under settings>reading.
Everything is working fine, but I want to add a section on the static front page that displays a preview of the latest blog post as well as the title (I want it to display the first 15 lines of the latest post content with a link to the full post).
I am having a really hard time finding the right code to put in the home-page.php template (Front page template) that will allow me to get the title and content from the latest post.
Also if anyone knows how to get the content with a character or line limit that would also be very very helpful!
- The topic ‘Get latest blog content for page-template’ is closed to new replies.