Showing just content on the screen
-
I want 1 post to show on the screen when clicking a page, without the title. Because i want to use wordpress as a cms.
Therefore i tried to modify the loop.The beginning of the loop first looked like:
<?php while ( have_posts() ) : the_post(); ?>
This shows the post header (“home”) and content (“this is the home page”) on the screen.
I only want the content so i changed it to:<?php while ( have_posts() ) : the_content(); ?>
Now i see 20 or 30 post beneath eachother. All containing only the header “home” .
So i look it up in the codex:
https://codex.www.ads-software.com/Function_Reference/the_post
And i modified the example a bit:<?php while ( have_posts() ) : the_post(); the_content(); ?>
Now i just see one post on the screen, but it looks like this:
_____________________________________
This is the home page
HOMEThis is the home page
_______________________________________Does anyone know what is going on and how i can get just the content as an output.
___________________________________________________
This is the home page
____________________________________________________
- The topic ‘Showing just content on the screen’ is closed to new replies.