I’ve run across this before. What I did was use get_posts() to return a list of the pages in the site and making the pages options in a drop down menu in a meta box.
// $your_args is an array that you've previously declared to get all the pages.
$pages = get_posts($your_args);
foreach( $pages as $page ) :
?>
<option value="<?php echo $page->ID; ?>"><?php echo $page->post_name; ?></option>
<?php
endforeach;
When you save the post, it will save the page’s ID in the custom post’s post meta.
Related Posts:
- framework for plugin/theme options panel? [closed]
- How to get the path to the current theme?
- How to include jQuery and JavaScript files correctly?
- Single functions.php or split into many small files?
- How can I configure Docker for developing and deploying a custom theme?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- What is the difference between esc_html and wp_filter_nohtml_kses?
- jQuery in header or footer
- Escaping built-in WP function return strings
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- What’s the difference between hooks, filters and actions? [duplicate]
- Customizer Not Saving Options
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- What function to hook for changes made in status and visibility of a post
- Example of uninstaller routine to remove all custom theme options from wp_options
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- How to determine if the current file is loaded in a plugin or in a theme?
- Filter, or any way to dynamically change theme screenshot image?
- WP_Query returns no results
- Should action callbacks start with a verb?
- Display content from custom post without modifying the single template
- WordPress not working on localhost
- Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?
- Can I change header.php of current theme through a plugin function?
- Creating a Link Text like Submit Button in Admin Page
- Beginner advice
- How to render a time-of-day string like ’16:42′ with a site’s chosen time format?
- Are block templates incompatible with serialize_blocks?
- SQL query for custom taxonomy slugs
- Tried in different ways but sidebar not working?
- How to hook a custom user function to a wordpress core ajax action?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- WP Gutenberg Blocks – How to limit first/root blocks
- How developed with version control word press site on shared host? [closed]
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- How to Get Current Custom Post Type Associated Taxonomy Term
- Plugin templates vs Parent Theme
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- Custom entity search and display
- Template directory in plugin
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- How to add plugin options in wp editor page
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Create fixed static pages
- Setting a post’s category
- rewrite_rules problem
- Why does website stretch and white space on load? [duplicate]
- Why my theme’s css not working on another site
- How to show comments from different Plugins to same post type?
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Override category archive page title (not the head title)
- Metabox types list
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Scripts/styles not loading on cloned WP Site when logged in
- How do I make two shortcode use the same id and increment it when I use them multiple times?
- Is it possible to modify an Elated plugin portfolio-list template in such a way that it will not conflict with future plugin updates?
- Post Pagination does not working on WP-Query
- How to CRUD from wordpress database in wordpress theme?
- Woocommerce Custom Checkout
- Dynamic sidebar areas not working on the Theme Customizer
- Caption Shortcode: what filter to change the image size?
- Merge Codes using redux framework
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- variable created in page.php is null inside of header.php
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Updating Style From WP Options Setting Page
- Create and style menu
- WordPress Beginer to Guru [duplicate]
- append code after the_content not working
- Problem with Poedit [closed]
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Invalid Menu Items
- How to get the value entered in the input field in wordpres
- How are themes and plugins localized using the gettext GNU framework?
- Theme, Plugin or Both?
- Hook a search form anywhere on the site, using a custom plugin
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- WordPress Block with Interactivity API e Preact Component