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?
- Change all author links in Blog roll
- Crazy Question – Updating Post ID
- create custom meta box with default value
- Problem with saving large amount of data in postmeta/usermeta
- Why I can not I use the variable outside my function?
- How to calculate the average of a post meta value(Numeric) of a specific author
- Get post ID from a link
- Is there any way to tell when wp_postmeta has been updated?
- Create a list of posts with topic headdings
- Add field to user meta table in database when link is clicked
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Move Title and the Content WYSIWYG editor position
- How to validate select field in post meta?
- wpColorPicker – problem with implementation to post meta
- retrieve the oldest post id
- How to use media upload on metabox post page without breaking TinyMCE?
- Edit multiple custom post types while saving a new or edited post
- Let’s Create Custom Field Template Documentation
- Upload attachment from external site
- Change post author without using wp_update_post()
- Show metabox value last post excerpt, title and link
- How add multiple wp_editor_box to new post
- wp_query with ajax
- Update post meta within save_post action
- How to store multiple custom meta box
- Display post number by category
- Output Post with ACF Fields into other Post
- Add two custom fields as a default to the “new post” page.
- Custom permalink for each post
- Is there a way getting post fields using `transition_post_status`
- Can I save post meta programatically without setting metaboxes?
- Automatic blog page with custom design [closed]
- After ajax image is outside the “ tag
- Edit custom fields in posts list
- How can I output WPAlchemy repeating fields meta values in my page template?
- Show number of posts by logged in user
- How does WP decide how to display a page
- Accessing Post ID Within Loop
- Adding JS functionality to the Publish button in wp-admin/post.php
- When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
- How do post IDs work in WordPress?
- Are post, page and category IDs unique to each other?
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Get post related to particular meta box? [closed]
- Insert data from custom created PHP page into wp_postmeta table
- linking to post outside the loop
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If custom field is empty, use one from a previous post
- If metabox has content display content
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- put saved metabox values back into fields and then display on the front end
- Widget to show posts in the sidebar basing on its IDs
- Get post category as a separate string and url
- Add a class to post_class if more than one post shares same meta_value_num
- Get a post’s ID
- Making posts permalinks consistent numbers
- How to get custom image field of specific post id
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Adding external field to my post form (admin side) and to post show (frontend side)