I am creating a Wordpress theme. Among the sections around the top of the page is entitled News. For the reason that section the consumer should have the ability to place information themself (I'll create a separate file known as news.php that will php incorporated in to the markup), however i likewise want this content to become instantly up-to-date when the user constitutes a publish.
For instance, when the user creates a brand new publish, I would like this news section to become instantly up-to-date to something similar to this:
A brand new publish was written, think it is here (where 'here' is really a hyperlink pointing towards the link to the publish).
edit Allow me to attempt to give a bit more particulars therefore it is clearer. This news section is going to be an unordered list. Thus:
<ul> <li> News item 1 </li> <li> News item 2 </li> </ul>
I would like the consumer to have the ability to add content towards the news section, also known as make new News Products, but while using visual editor of Wordpress so that the consumer does not need to comprehend the code and does not need to copy/paste the LIs.
In addition, each time a new publish is released, I would like it to appear as:
"new publish released, think it is here" where 'here' is really a hyperlink with connecting towards the publish.
Is easy to accomplish?
create a Categorie, or perhaps a Custom Publish Type known as, "News" then when the consumer produces a brand new publish, but wants so that it is within the "News" section all he needs to do is click the Category "News." You might produce a custom publish type, only for "News" and also have custom taxonomies etc too.
Then when you wish to print this news publish inside your theme, write make use of the query publish function and limit the loop to "category_title=news"
Basically properly understood, you'll need write something similar to this:
<?php query_posts(array('posts_per_page' => 1)); the_post(); ?> A new post was written, find it <a href="<?php echo the_permalink();?>">here</a>
Latest news list
<?php query_posts(array('posts_per_page' => 6)); ?> <ul> <?php $count=0; if (have_posts()) : while (have_posts()) : the_post(); ?> <li><a href="<?php echo the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; endif; ?> </ul>