I don’t know exactly how your code works BUT I do know this. If you only have one loop on the page-template you could use query_posts();
but if you have more than 1 loop it will screw up the code, even if you reset it. I would recommend you to use WP_Query
like this:
<?php
// The Query
$the_query = new WP_Query('category_name=vacancies');
if($the_query) echo '<ul>';
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<li><a href="https://wordpress.stackexchange.com/questions/36863/<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php
endwhile;
if($the_query) echo '</ul>';
// Reset Post Data
wp_reset_postdata();
?>
Related Posts:
- Get content from one page and show it on another page
- Why content_arr[‘extended’] removes paragraph tags?
- the_content() Not Grabbing All Content
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- Stop WP from creating “Sample Page” and “Hello World!” post
- Keyboard shortcut for updating a page or post?
- Apply the_title() filter in post & page title, but not in menu title
- Difference between an archive and a page listing posts
- The next_posts_link() works only with original $wp_query
- Using single.php from plugin folder instead of default template folder
- Skipping first 3 posts in wp query
- How to display the page title/content in the Posts page?
- How to disable content pagination?
- Callback for wp.autosave.server.triggerSave();
- How can I see a list of pages and post where my custom Gutenberg block is used?
- disable password protected page for logged users
- RSS for Pages Instead of Posts?
- Adding a div class or id inside the_content()
- Display posts by tag on page
- Set number of article per number of page
- Pagination for Pages and Posts
- Overview with latest edited posts and pages
- Creating new page with pre-defined parent page
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- How to add custom content (text/image) at start of content (IN content ie the same line)
- Edit menu item title from edit page/post
- How to show video from specific category on sidebar?
- Changing my permalink structure – will new layout conflict with existing page?
- Private Posts/Pages & Search
- White Blank Page when Updating and Publishing Page/Post
- Posts vs. Pages
- Can’t get the_content of the parent page from its single post?
- Disable most recent & view all (TABS) on nav-menu.php
- How can I schedule a PAGE to go live at a future date/time?
- How to add pagination in between post and comments?
- Add Word Limit to Posts
- Adding the_date inside tags around the_content
- How to insert 2 args into 1 Wp_Query for a slideshow
- Post categories to pages
- get query() without post content?
- Second comments section for one post/page
- 404 error on default post type and default taxonomy fronted page
- How do I do a page break?
- 2 dynamic sidebars registered, not showing up
- How to make default “Privacy Policy Page” a normal page?
- How to detect when admin user is on the All Posts page?
- static landing page leading to author specific pages w/ “live” content
- Total number of posts in query (category/tag/author/search results/main page…)
- Custom Permalink Structure for Pages & Posts
- Getting a “404 Not Found” error when “Preview Changes” is clicked
- New Posts and Pages Won’t Save
- My Custom Post Type Still Using index.php
- Post/page title to permalink transformation – what is behind the scenes?
- Would a “hub” page work better as a page or a post?
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- Page of posts made to look like homepage
- How to link post titles on page A to its posts on page B?
- Direct some posts to only appear on a specific page
- Different post views for different category views
- Changing permalink of WordPress
- Creating a redirect option for current page url
- Indenting within a blockquote
- Create a List of Widgets, where each widget holds three attributes
- Change published date and time using SQL query for page in every 5 hour
- Is there a way to know when a page has been updated and do some action only once?
- How to limit wordpress the_excerpt() dynamically
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- Put page on Archived statut after end of publication date
- How to add a block to a category page?
- post and page and custom post type
- Page with Category Returning 1
- Using WP page password protection as defacto login
- calling pages instead of posts
- WordPress display page information rather than post
- Post Category link is same with Page link
- Is it possible to query a category with specified posts?
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Permalink base only for posts
- Precedence of page permalinks over woocommerce product category links?
- WordPress URL question
- Theme does not respect spaces between paragraphs in pages
- Page and Posts loading as index page? Not loading the content
- My blog “page” used to show a list of posts, but now it’s just showing the page content?
- Converting Posts to Pages
- 404 error on every post and page other than home
- Using Post ID and Page ID in same function
- get next/previous post name
- Get post title of faulty link on 404 error page
- Get current post’s child page?
- The next_posts_link() works only with original $wp_query
- Stripping tag from elements in post
- Limit amount of pages shown in pagination within wp_query
- how to show all type of author posts in author page (SOLVED)
- custom post type single page template not working
- How to make posts appear under pages
- When and how will php code in a user made WordPress page be executed?
- WordPress Page Column Problem [closed]
- What function does the loop of displaying posts?
- Edit Page button is gone