In your tax query, you’re searching for a string instead of a variable, the only time it will match currently is if the term is literally “$page_slug”. You should remove the single quotes around the $page_slug
to have it parsed as a variable, so:
'terms' => '$page_slug'
should be:
'terms' => $page_slug,
Related Posts:
- How to set post slug when using wp_insert_post();?
- Can I have two child pages of different parents with the same name?
- Creating a template using a specific slug name, for a page with a parent page
- Slug is redirecting to 404
- List child pages by slug not ID?
- Create a page that’s to not be indexed or accessible via slug
- Get the Current Page Slug-Name
- Attachment pages stealing page slugs
- Is it possible to restrict access to specific pages in the admin area based on the page slug?
- Is it possible to change slugs’ default behaviour?
- Page Slug Won’t Change – Can’t Edit Archive Page With Slug or Reassign Slug
- Can’t find the page that is using a slug
- How do I locate a third party page represented as a slug in my WordPress website?
- Cannot use old slug – it just 301s to site home page
- Using Page/Post Slug In Link / URL
- Create a page without adding a page in the Database
- What methods to use to create small, editable pieces of text for static pages?
- Restrict admin access to certain pages for certain users
- Require title for pages
- Add a new page to wordpress programmatically
- Get Permalink for the top level parent of child pages
- Get page id by title?
- Editing the Number at the end of Page URLs / Editing Page Slugs
- List all pages and children in separate ul
- How do I load custom scripts and styles for a page?
- WP won’t save changes in post (any)
- Call the content of a page in AJAX in WordPress
- Password Protected Page Not Displaying Content After Entering Password
- Created pages not showing up in ‘All Pages’ list
- Registering multiple sidebars with data from an array
- How to exclude shortcode from specific page IDs if it’s set to global
- How to dynamically save a selected option from page “Templates” selectbox?
- Play Video on Homepage Only
- Extra title output with this function wp_list_pages
- Are Pages the right thing to use for making sections of a single-page site?
- Allow contributors to create page (but not publish)
- add new metabox to page editor with just page parent
- How to open a phpBB forum in the same website as sub-page [closed]
- How to setcookie if is_page(‘page’) ? should I use add_action(‘init’) or there is another action?
- Why do pages in WordPress have a hierarchy but menu’s also have a hierarchy?
- Text Editor Tags
- Column Images Showing Gaps
- Custom page template with entirely different design. Is it possible in?
- Page template no longer exists – metaboxes won’t save
- A static page view call every custom page templates
- Wrapping images in tags based on size
- Get the ID of the direct parent page
- External stylesheet per page
- How to add prefix slug in static wordpress page?
- how to avoid the character conversion of WordPress pages?
- How to make a page unsearchable in blog search?
- Query specific Pages
- Phantom page can’t get rid of/can’t get at to change
- page-slug.php not working but only for specific slug
- How can I send an email when someone uses the HTML download Attribute?
- Rewrite to load homepage for a different url
- logout redirect only from admin page
- multiple post into single page
- Later blog post pages give 404 error
- Different css file not working for the page template I created
- redirect index.html inside folder to wordpress page of same name
- Show content if page is a grandchild of top level page
- Does Feedburner send notifications about WordPress pages?
- Using index.php as page template
- Ordering Pages and Increasing Navigation
- Static Website No Titles But Still Nav
- Search results to be only posts & children of page ID
- What’s the section of code (or loop) which retrieves the Page title and description?
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- How to backup just pages from my site, but not posts with other post_type values
- On the list of Pages, clicking to Edit a particular page redirects to the list of trash
- My pages are using my Index.php and not my page.php
- WordPress custom pages in a folder
- How to delete the scrollbar in my pages?
- How to make a page as default page for a theme without a plugin?
- Return true if parent page id matches
- Not allow add New Page for role ‘editor’
- How to detect if some page template has been selected
- Why Google map can not show full size in a page?
- What’s the best way to manage sections on a page?
- Display grandchild page content on parent page
- How do you assign custom template for Posts page (under Front page displays setting)
- Category Page Custom Layout [closed]
- How to copy specific page content and create child page?
- Adding CSS styles to Admin Area PAGES only (not POSTS or CPT)
- 1st Level Page with No Children
- Previewing Draft shows white page, publishing works fine?
- Add feed to a custom page
- Directory location of new page
- Grabbing the_content from “about us”
- making a pseudo-static page
- Page specific values in widgets
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- Woocommerce – Making product pages child of shop
- Show different number of posts on second page of category
- Use get_posts() with ‘post’ and ‘page’ queries at the same time?
- appearance of new page
- How to read a page’s “Shortcodes” from the Template File?
- For some reason my posts are not showing up on my front page [closed]
- Fresh WordPress installation not able to simply show page content