You can use get_queried_object_id()
to retrieve the page ID.
$custom_seo_desc = \get_post_meta( get_queried_object_id(), 'custom_page_desc' );
You can verify the page for posts ID by looking at the option page_for_posts
.
$posts_page_id = get_option( 'page_for_posts' );
Related Posts:
- How can I retrieve multiple get_post_meta values efficiently?
- Update all posts automatically when using post_meta
- How to batch update post content with custom post meta value
- Better post meta efficiency?
- meta_box or custom_field as a second tinymce post-instance?
- Create A Metabox For A Custom Field
- Change post format using custom field
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Using radio button meta data from a custom meta box
- What Is meta_id In wp_postmeta?
- Add custom field automatically (add_post_meta) with value based on number of words of article
- Automatic value for custom fields for posts
- Understanding and using metaboxes in posts
- How can I sort posts by the date and a custom meta field?
- Meta value does not save for scheduled posts
- Cannot retrieve a custom RSS field from posts
- Customize rel=canonical tag for single blog post
- How to save meta checkbox WordPress
- Hide custom metabox value from custom fields
- Get post meta retrieving wrong value
- if in category but only with post meta
- Updating post meta for checkbox
- Saving Post Data in Another Database
- How can I tell if a post has been published at least once?
- Add multiple meta keys to a post at once
- WP_Query custom field pass the post id
- Adding a meta box to determine the sidebar [closed]
- The loop starting at a certain ID
- saving/reading custom field value does not work – no value gets POSTed
- Simple Custom Metabox Not Saving
- Why my meta boxes won’t show in front post page?
- Display content between two dates?
- Post meta not working
- Adding an option to post editor to show a site disclaimer or message
- How do you update post date (year only) in a separate custom field?
- WP_Query sort by meta_value_num or date
- Creating Ordered Query using Meta_key
- Using Post ID and Page ID in same function
- How can I create a menu items from meta box based on users input
- How enter custom post meta or custom field on box post list archive page?
- How to check if post meta key exists or not in wordpress database
- get all posts ID from a category
- Setting post meta data to random value during post status transition / on publish
- Add custom field to all posts in specific category
- Get the post_id of a new post
- Does WP get all post_meta on POST page?
- Using Custom Posts with Metaboxes and Drop-downs
- How to add a custom field after wp post
- Custom fields on a virtual page
- Get a custom field of all posts on current blog page
- Only display posts after current date
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Guest Author – How to display posts on /author/ archive page
- Why is my Blog Page ID == First Post ID?
- Two Custom Post Types Many to Many Relationship
- Button inside Custom Meta Box triggering the Update Button
- Getting value from get_post_custom
- How to validate select field in post meta?
- wpColorPicker – problem with implementation to post meta
- Upload attachment from external site
- Update post meta within save_post action
- How to store multiple custom meta box
- Custom permalink for each post
- Is there a way getting post fields using `transition_post_status`
- How can I output WPAlchemy repeating fields meta values in my page template?
- How do post IDs work in WordPress?
- put saved metabox values back into fields and then display on the front end
- How to get custom image field of specific post id
- How to get value in radio input in post meta box?
- Will multiple category descriptions effect my search engine optimization?
- Automate post update for all posts?
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Featured Images most often doesnt appear
- How to improve my non-unique metadata MySQL entries?
- Reuse old post ID for new post after deleting post
- How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
- I need show posts by customer (Shortcode)
- How can i take all ids from untrash_post action?
- Auto populate custom fields by post date
- Best Way to detect unique posts in wp rest api
- ACF Relationship – Get Parent’s Post Object
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- Delete custom post type metadata without deleting the post in admin area
- Remove All in One Seo from Posts for Contributors
- How to retrieve a post by inputing the url in a custom field and displaying it on an options page
- Display Data From This Custom Media Upload Meta Box?
- Custom fields in normal posts
- Show posts between two Custom Fields date
- How can add metabox for post of specific category before save post and after save post [duplicate]
- Ordering posts alphabetically by meta keys and title
- unused post IDs
- get_post_meta property of non object
- How to make a local “scroll to ID” on post?
- If meta_key exists then don’t select this post?
- What is $post->ID
- Read more opens attachment
- How to make internal links creating plugin to respect ACF?