The the_ID() function that you are using in your code echos the current post id, to get current post id instead of displaying it use the function get_the_ID() as shown in the following code.
Alternatively you can just use get_post() function without passing any post id as a parameter because the post id parameter is optional and if you don’t pass any post id then by default the current post is used.
Try using the following code instead of what you are using.
<meta name="description" content="<?php $post = get_post(get_the_ID()); echo strip_tags(substr($post->post_content,0 , 150)); ?>">
Related Posts:
- wp_redirect() – headers already sent
- Auto get_header and get_footer on every template?
- How can I get wp_head() as a string instead of echoing it?
- Template Hierarchy for get_header()
- How to remove header images from all pages except the home page? skeleton theme
- Add social icons in a theme through custom admin menu
- Fatal error: Call to undefined function get_header()
- How can a Theme Contain no Header File or Footer File?
- How do the default themes reference style.css?
- How to remove the header from all pages except home?
- Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
- How to remove header image in Twenty Eleven theme?
- How to create a fixed header and scrolling content area
- Dynamic menu links after header title
- Second menu has the first menu ID
- Changing footer depending on URL (poli language site)
- header, stylesheet not being read
- Why is the `if else` not working?
- How to add cropped custom header image?
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Change header image on a particular page
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- How to create full header but keep content narrow
- What is the constant WP_USE_THEMES for?
- What is the difference between front-page.php and home.php? [duplicate]
- Strict Standards Error bootstrap navwalker
- Specify image dimensions
- Adding Action Hooks In Parent Theme For Easier Child Theme Customization
- register_sidebar ignores ‘id’ and ‘class’
- Add colors to existing color palette without replacing it
- Add link option to featured image?
- How to hide and content from auto-generated excerpts?
- Custom CSS In Uploads Folder
- Default header image does not display
- A guide or tool for inserting bootstrap in underscores theme? [closed]
- What is the right way to make custom main page?
- .sub-menu or .children?
- Custom CSS without css.php file
- How to echo category_description() without stripping out html tags?
- Understanding WordPress(framework?) Web Development
- For best DB performance should I serialize all theme options together or by type?
- Stylesheet not linking
- How to control layout of posts on page?
- saving row as a template using WPBakery Page Builder is not working [closed]
- Non-Blog Website without Search: are comments.php and search.php in theme still required?
- Custom metabox for custom page template
- Display recent posts with thumbnail
- Custom Widget options in theme
- Include Parent functions.php in Child Theme functions.php
- Redirect to specified page when insufficient permissions?
- Primary navigation menu & footer not showing in category / tag page
- Jetpack Comments with fall-back
- wp_script_add_data doesn’t seem to work
- Exclude read more in the_excerpt [closed]
- Where am I doing wrong in my theme menu?
- Calculate data and passing to Theme
- Alternative to file_get_contents() for theme operations
- Updating a live theme safely?
- How do I remove inline style in featured image markup?
- Change Responsive Images Maximum Width of 1600px
- Why is my CSS not loading?
- How to find default functions of wordpress
- How to remove ver from stylesheet URL? [duplicate]
- How can I hard code my sidebar?
- wp_nav_menu with default pages menu
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- using Options Framework – can “theme-textdomain” domain be changed?
- How to add sidebar to Isola theme? [closed]
- Filter to remove the default password on “Your Profile” page
- How to add testimonials with an image?
- How to setup sidebar modules to use jQuery Accordian
- WordPress Animation Adjustments
- theme directory fallback image outputs url and not the image
- Unexpected behaviour of class_exist
- Theme functions don’t work as expected in partial included via get_template_part() after custom query using Ajax [duplicate]
- How can I not disable my theme when I want to upload a new version of it?
- Avoiding do_shortcode() loops
- Exporting wp site as a theme
- What is the general function to add a Widget area (not of a particular type)?
- WordPress Post Order
- Why content is not adding for each blog post
- how can I re-utilize and class on a child theme
- How to manipulate wordpress template tags’ output
- Automatically Add Caption Shortcode to Image with Caption Field Filled In
- Recent post in the middle of the content
- How to figure out which wordpress theme a site was using?
- WordPress Footer Widget Processing
- Flexslider not working for my custom theme WordPress
- How to Remove Sidebar when get_sidebar() is not get called in page?
- How does offset works on pagination? (get_results)
- Plugin or script to apply updated media settings to all featured images
- Header links also appearing in the footer
- Extending arrays in parent theme without completely overriding the files
- WordPress Subpages Fancybox Trouble
- Toolbox theme using printif statement – help needed understanding code block
- WordPress does not know the parametrs i sent to admin post
- Custom Single Page Portfolio Theme [closed]
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Theme template file for a specific custom taxonomy
- How do I work with responsive images in WordPress? (img srcset/sizes)