How to use pages over posts for snippets in a custom WodPress site
-
Hi,
For a while now, I have been using posts to “pull” certain bits of content onto a home page or any other page. The problem with this is that if someone clicks on that link it will go to.
https://www.example.com/decaf-for-all
instead of
https://www.example.com/news/decaf-for-allUntil now, this is the code snippet I would use pull the post out of the db, but I would like to know if this is possible for pages too please.
<?php query_posts('category_name=book-now-button&posts_per_page=1'); ?> <?php while (have_posts()) : the_post(); ?> <a class="book-now" href="<?php the_permalink() ?>"> </a> <?php endwhile;?>
Essentially, rather than any posts, I want to use only pages, so that WordPress works more like a general CMS than blog.
Many thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to use pages over posts for snippets in a custom WodPress site’ is closed to new replies.