You can use get_the_ID();
function to fetch the Id of the current post
For more Please visit here
Related Posts:
- Load entire NextGEN gallery from single thumbnail?
- When calling wp_title(), do you have to create some kind of “title.php” file?
- Sharing templates with the JSON API?
- Set template based on query in URL
- Which has more impact on site performance? Template overrides or hooks
- Is there an action hook that fires just before a template is loaded?
- if page is parent page redirect to first child with hook / polylang
- How do I override the search template in a plugin?
- How can I add text to a specific ‘Edit Page’?
- Genesis – Adding custom hooks to display secondary navigation
- Can i exclude certain page templates for a specific role?
- How to add description over forum list on bbpress root page
- What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]
- Given a page ID, how to display entire page (header/content/footer/sidebars) from a plugin hook
- AJAX requests within templates
- How to add a new product type on woocommerce product types? [closed]
- Where is get_header(‘shop’) file in Woocommerce templates
- Template issues getting ajax search results
- WP frontend output of custom textarea fields not respecting line breaks. In admin it’s OK
- Custom reset password template after forgot password request
- Child Theme: how to override variables?
- Detecting post type within init action
- How to create tag.php
- Get template part vs locate template function
- Tools for Converting an Existing Website Design to a WordPress Template?
- author.php added to template not working on Nginx server
- wordpress – load a template based on the URI
- How to include template according to meta post value
- Using Includes in Templates in Document Head
- How to show scaled featured image in template?
- Load template inside a parent template
- Using wp_ajax and wp_ajax_nopriv hooks
- Child theme TEMPLATEPATH issue
- The correct way to override WooCommerce product gallery from a plugin [closed]
- Unable to create custom search results template page
- Updating modified templates
- Template for slug
- Hook to get the page template that is in use on the admin page edit screen?
- “Issues” loading MANY featured images on a single page (custom template)
- WordPress Shortcode wrap around div
- How to add an HTML tag to the Header?
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Missing ‘Page Attributes’
- how to use custom page template in a page?
- include ‘wp_enqueue_scripts’ (CSS) to multiple templates
- Is there a way I can put my post templates in a separate folder?
- new page sidebar-template by default
- Get link to a specific template file [closed]
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Default Template Selected After Changes in Elementor [closed]
- Include Custom Style & Script into Custom Post Type Single Template
- Standard WordPress Search does not work / Search-results are not displayed / Custom template
- How to preserve changes in templates and other files
- Adding Query to Custom Page Template
- Whats the template of my homepage?
- Custom headers based on taxonomies
- Send post id through ajax and get the post content back
- Template issues getting ajax search results
- Override Dokan Includes File in Child Theme
- How to get link to homepage
- How is WooCommerce cart.php template supposed to be used?
- Two exact templates, sidebar showing in one but not the other
- Taxonomy term page going to 404
- How can I use default CPT templates from sub-folder?
- How to set page title tag in custom template for non-Custom Post Type?
- Utilising an existing page while using the “s” query parameter
- Page header on specific page is different from the rest [closed]
- Can a link in WordPress contain a query string that is picked up as $_POST
- ajax problem – function on server is not called
- Is it possible to access plugin data from a custom feed template?
- How to use a template file to show all post having same metakey
- Automate configuration after new/hosted installation
- Modify just ONE page based on a template
- which template does wp_ tag_ cloud point to?
- Pagination problem (plugin wp-pagenavi) with a custom post type?
- Add an anchor link to a ‘plain’ HTML file, without over-writing the entire site?
- Template part including not working
- Parent/Child themes – both CSS files loaded
- call_user_func_array() expects parameter 1 to be a valid callback, class ‘WC_Rapyd’ does not have a method ‘install’
- Would like to use hook or filters to customize email templates
- front-page.php includes a placeholder text field. How to get rid of it?
- Display a custom 404 page without a redirect
- Template and URL parameter problem
- get_users by role returns all users
- Ajax Category add doesn’t update the list table custom column
- Validating Error with submit button
- How can I alter a post?
- What is the purpose of the $before and $after arguments on the the_title() function?
- Error while submitting form using AJAX and php
- Remove ” Browse Category : ” from Archive title
- When to use content-pagename.php?
- Using external file with WP_USE_THEMES set to false causing 404
- change attachment custom field onChange event
- MailPress plugin: table inline style tag removed when sending the newsletter
- Custom Archive with Content for Custom Post Type
- How to make plugin work in each template in wordpress
- Load featured article once in a loop
- Why wp_ajax hooks doesn’t work?
- Implement HEAD and TITLE tags with DB DATA
- Custom Post Type Trouble