You need to echo
the return value from wp_get_attachment_image_src()
. It also returns an Array()
, so you need to grab the needed part from that array. In this case it’s the first/0
value. Example:
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<div id="post" class="your-class" style="background-image: url('<?php echo $thumb['0'];?>')">
<p>your text demo</p>
</div>
Related Posts:
- Displaying Child pages of the current page in post format and their thumbnails (featured image)?
- How do I use featured images on index.php?
- Only Display a Featured Image on First Post Page
- Outputting content from page
- Featured Image not displaying in a page
- How do you add a featured image to a page (not post)?
- Get page id by template
- How can I keep the content of my pages version controlled?
- Editing Complex Pages in Visual Mode
- Multiple areas of dynamic content in a page
- How to create virtual pages with information from user meta profile fields?
- Increment Page Order As Pages Are Created
- Private pages that work when you are not logged into WP admin
- Is there a way to remove or hide individual pages on the Edit Pages screen?
- Add custom admin menu item for pages using a certain template
- Where does the 404 redirection happen?
- How to limit page pagination
- Add custom text at bottom of every page?
- Remove specific page/post from feed
- Want Page Title to show on menu, but not on page
- Personal page for every user (not just authors)
- Create ghost page
- load common thank you template with different content for different pages
- List pages by custom field?
- Password Protected Page Title
- Send mail from page using wp_mail
- Edit page’s “Restore the backup” link does nothing
- Load specific page template based on URI
- Show preview posts and pages to clients
- Site url is not showing the home page
- I can’t edit my homepage – the page editor is just blank [closed]
- Page redirects to archive
- Making audio playlist by getting page’s parent’s ID
- Restricting Pages based on Hierarchy and User Role
- Pages Column Sorting WordPress Version 3.0.3
- Adding Page URL to the Pages Admin Table
- More Fields Required For Password protect page
- page-name.php doesn’t execute on custom template
- Add categories and posts to page hierarchy
- How to retrieve attachments from child pages of a specific Page?
- Admin taking a very long time to load
- Hide page templates without using ‘unset’
- Custom page with queries returns 404
- WordPress Site Page Exists but Error 404
- How to capture GET argument on static page
- page.php is not called, falls back to index.php
- Custom page in archive page for certain category
- I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?
- Is it possible to check for shortcodes on a page?
- WordPress 3.2 – removed ability to select a page template in the page attributes when adding a new page?
- Can I “protect” a page with a form asking for an email address?
- Use same page-mypage.php template for several pages
- Is it possible to restrict access to specific pages in the admin area based on the page slug?
- Make “default” wordpress pages & features unaccessible
- How to create cutom link for page
- Set a variable to using in redirected page
- creating single page with 2 columns while theme is 3 column
- Use an archive as the parent of a page?
- Publish page by invoking submit via jQuery
- Modifying .page-content background image
- Displaying the blog entries in a Page (using get_posts to retrieve the posts)?
- products category page editing
- “Can’t update in WordPress”
- Different template parts when on different pages
- Updating page template pragmatically
- Why can’t pages be categorized / tagged?
- Adding in additional pages into a custom theme
- Pages in wp-admin is not found 404
- Shortcode runs when editing page
- List of pages of a specific user
- wordpress page navigation numeric pagination showing same posts on each navigation
- WordPress dosn’t save page/post updates
- Multiple meta_key with get_pages
- Sup pages can’t be found
- How to use wp_dropdown_pages or wp_list_pages to accomplish a menu like this?
- Get child pages in get_pages function
- WordPress Page All Content In Template Good Or Bad Convention?
- Bundle a page with custom url and a function
- Featured image url
- Custom Upload Adds Ghost File
- Displaying Content Only in Certain Page IDs Not Working
- WordPress white screen with “All Pages”
- How to Change the path of a child page?
- Annoying notification when trying to create a new page
- Page stuttering on load
- How To List Sibling Pages And Include The Featured Image?
- WP Template Hierarchy – Need help choosing the correct templates
- the_content() Returns post content when I want page content
- disable trashability for certain pages
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- Can’t select a page using is_page()
- If searched in a category show different 404 page
- pages won’t show on front page using loop or pre_get_posts
- How can I cycle posts with a #next and #previous script?
- Does WordPress list all pages for crawlers?
- List of pages – AJAX load more
- one time visit to the page
- How to display child page from specific parent page in homepage?
- How to display text of a page in home or custom page?
- Fresh WordPress installation not able to simply show page content