It works on WordPress – Simple code examples for wordpress, copy it, paste it, and it works.

10/07/14

Change Featured Image Box Text to Custom Help Text on WordPress Wp-admin

08/09/14

Adding Custom jQuery to WordPress Footer

02/04/14

How to Filter Posts by Author in WordPress Admin Post List Screen

01/22/14

Connect to a Second Database on WordPress and Display Results from It

01/15/14

Displaying WordPress Menus Wherever You Want on Your Theme
screenshot-2

01/13/14

WCCTM PRO and WCCTM, Cool Plugins to Build WooCommerce Product Categories Menus

01/10/14

Enabling Login by Email on WordPress

01/03/14

Redirecting After Login on WordPress Depending on User’s Role

11/26/13

WordPress Cool Category Tricks(Snippets)

08/27/13

WooCommerce, How To List Product Categories(With Thumbnails) and Subcategories
screenshot-1

08/27/13

GPLWT Reaches 20,000 Downloads And Offers New Amazing Features on the PRO version!

08/15/13

Adding Categories and Tags on WordPress Pages

08/14/13

Get Post List Thumbnails PRO Available: CSS Formats and Colors For Your Post Lists

08/02/13

New Plugin, Gambit Arrow Custom Front End Translator
GPLWT 10

06/05/13

Get Post List With Thumbnails 10 is available!

02/07/13

Changing Ajax Loader on WooCommerce Cart

12/21/12

Formatting User Login With jQuery on WordPress WP-Admin

12/13/12

Adding jQuery to Wp-Admin using WordPress Native Hooks

10/30/12

Binding WordPress Custom Post Types to Users Through Meta Boxes – Part I

09/04/12

Display All Images From a WordPress Post on a List(Separate Content Images and Text)

08/25/12

Basic jQuery Floating Arrows Navigation Bar

07/12/12

Using XML and jQuery to Populate a Drop-Down Box

02/14/12

Basic Nivo Slider WordPress Custom Post Type Integration

01/27/12

Building a Custom WordPress Links Page Loop

01/25/12

How to Hide Fields from Edit Page for a Specific WordPress Custom Post Type

01/24/12

How to Use WordPress Shortcodes Directly on Your Theme’s PHP Files
Stop SOPA Ribbon WordPress Plugin

01/18/12

Learn How to Add a Stop SOPA Ribbon to your WordPress Website
Felipe Caroé - Brand Manager

01/16/12

Attachment Loop With Dynamic File Icons on WordPress
WPWorking want your WordPress codes

01/10/12

Share Your WordPress Codes on WPWorking

01/05/12

Meet YouTubeNails 3.0.0. for WordPress – a Simple Tool to Display Thumbnails from Vimeo and YouTube Videos
Baller Wives

01/05/12

Baller Wives is using Get Post List With Thumbnails to list popular posts
Get Post List With Thumbnails reaches 6,000 downloads

12/15/11

Get Post List With Thumbnails Reaches 6,000 Downloads with a cool new feature!
Rockateca is using Get Post List With Thumbnails

11/28/11

Rockateca is using Get Post List With Thumbnails to list News, Articles and Reviews
Outside Context Travel Articles

11/09/11

Outside Context is using Get Post List With Thumbnails to Display Travel Articles
My Calabria

10/19/11

My Calabria is using Get Post List With Thumbnails to Display Places to Visit in Calabria
Dennis Ritchie

10/14/11

Get Post List With Thumbnails 8.0.4 – Displays Pages, Excerpts and More…
abismo

10/13/11

Building Shortcodes on WordPress(and placing it on the right place)
RIS Labs 2.0 — Dance Music Development

10/10/11

Rock It Science Laboratories is Using Get Post List With Thumbnails to Display Artists
Steve Jobs, Idol and inspiration

10/06/11

Page Navigation on WordPress Custom Post Type Pages
screenshot-2

10/05/11

Get Post List With Thumbnails Reaches 4,000 Downloads!

10/04/11

Retrieving The Total Number of Posts from a Specific WordPress Custom Post Type
What to Cook Today? and Get Post List With Thumbnails

10/03/11

“What to Cook Today?” is Using Get Post List With Thumbnails to Display Recipes

09/27/11

Get Post List With Thumbnails 6.0.0 Sorts Posts by ID, Date and Title
Satiama

09/26/11

Satiama Lists Articles Using Get Post List With Thumbnails

09/23/11

WP e-Commerce Product Showroom reaches 5000 downloads

09/22/11

WP e-Commerce Product Showroom 5.0.0 – Supports Multiple Widgets and Shortcodes

09/15/11

Display WP-ecommerce Products Categories(and Subcategories) as a Select(Drop Down List) Menu
Get Post List With Thumbnails

09/09/11

Get Post List With Thumbnails reaches 3.000 downloads!

09/08/11

Display WP-ecommerce Products Categories as a Select(Drop Down List) Menu

09/01/11

New Hack for Displaying a Category / Subcategory Menu on WordPress

08/30/11

New Hack for Displaying a Category Menu on WordPress

08/25/11

WordPress WP-ecommerce Search Page with Related Products Hack

08/22/11

WordPress WP-ecommerce Two Images Hack on Single Product Page

08/16/11

How to Hide Add New Buttons For a WordPress Specific Custom Post Type on Wp-Admin

08/15/11

How to Change The Logo on WordPress Wp-Admin Login Page

08/11/11

How To Display Custom Help Box On WordPress Wp-Admin
Chewbacca-And-C3-Po-1-1024x768

08/10/11

The New WP e-Commerce List Products and Images Hack

08/09/11

WordPress Wp-Admin Menu Hack – Hide Menus From Specific User

07/04/11

Quick solution to display a menu like list of WordPress Custom Post Type Posts(with Custom Taxonomy) in case of emergency

07/04/11

How to reset queries on WordPress
tinymce

04/28/11

How to Stop WordPress Editor From Removing Break Tags

and

Genres for videos

04/20/11

WordPress Custom Taxonomy Page Example with Taxonomy Selection Function(select field)

04/15/11

How to Hide the Update Reminder on WordPress

04/12/11

Simple Way to Make WordPress Comments Functionality Work on Your Theme / Blog / Website

04/06/11

Retrieving The Total Number of Posts from a Specific Custom Post Type WordPress Taxonomy

03/30/11

Building a WordPress Rewrite Rule(Passing and Receiveing Parameters Using Permalink Url)

03/28/11

WordPress Custom Taxonomy Page Example – Displaying Custom Post Types Posts

03/24/11

Get Post List With Thumbnails 2.0.0 – Displays a List With WordPress Posts and Custom Size Thumbnails

03/17/11

Displaying Info From a Specific Custom Taxonomy Term(Hierarchical Taxonomies) On WordPress

03/04/11

YouTubeNails 2.0.0 – Displays Thumbnails for your YouTube videos on WordPress sites

02/24/11

Meet WP e-Commerce Product Showroom Plugin – a custom list of products

02/15/11

Registering and Displaying WordPress Custom Post Types In a Very Easy Way

02/08/11

Pass form values to WordPress query_posts(category name / category id) function to retrieve posts from a specific category

02/01/11

Display WordPress Post List With Custom Size Thumbnails(the first image of each post)

01/27/11

Display WordPress Page Navigation on Category Pages – A Very Easy Way
wordpressdatabase

01/24/11

Inside The Database: WordPress posts, categories, media and relationships

01/15/11

YouTube/Photos Thumbnails on WordPress Similar Posts Plugin List

01/13/11

Displaying categories and subcategories “tree like” list on WordPress

01/12/11

WP e-Commerce List Products and Images Hack

12/27/10

Image gallery(thumbnails) with WordPress image cropping

12/23/10

Get the first image from wordpress posts(content)

12/23/10

Display YouTube Thumbnail with wordpress custom field

12/23/10

Remove first image from a wordpress post(the_content)
Share on TwitterSave on DeliciousShare via email

16 Responses to “Remove first image from a wordpress post(the_content)”

  1. Kean January 12, 2011 at 11:12 am #

    Thanks for the function, it has come in rather handy for a project I’m working on. One issue I came across was where you used strrpos(). This seems to have issue if the post contains any other html coding, I found changing these to strpos() seemed to solve the issue.

    • Alvaro Neto January 12, 2011 at 11:33 am #

      Kean, I’m glad my solution was usefull for you. You are right about the strrpos issue, thank you. I’ll rewrite the function, test, and put it here.

  2. kistian February 4, 2011 at 4:28 pm #

    I have and error.
    If there isn’t an image in the content, get_the_content doesn’t work

    • Alvaro Neto February 4, 2011 at 5:13 pm #

      Kistian, you were right, there was a issue on the function. I changed a couple of things and tested many ways. Would please try to use it now? Please let me know about any possible new issue. Best regards.

  3. kistian February 4, 2011 at 4:39 pm #

    I asume that is necesary delete the function with the echo clear_first_image(get_the_content());

  4. Alvaro Neto February 4, 2011 at 4:43 pm #

    Kistian, thanks for your comments, I’ll check it out as soon as possible, and let you know. When I’ve tested, I thought did it with two situations, with one or more image and no image on the content, I’ll check it.

  5. Ruud February 4, 2011 at 8:03 pm #

    Does this work for images linked from blogger?
    Apparently no, but anyway is a great trick

    • Alvaro Neto February 4, 2011 at 8:11 pm #

      Ruud, I’ve tested it right now, and it’s working, with a image linked from blogger. Please let me know about any issue, if you use my function. Best Reagards.

  6. kistian February 4, 2011 at 8:37 pm #

    It’s work for me.
    Thanks a lot for everithyng Alvaro!

    • Alvaro Neto February 5, 2011 at 3:16 am #

      I’m very glad to know it’s working, Kistian. Thank you for visiting my blog. Best regards.

  7. kistian February 7, 2011 at 1:11 pm #

    when you see an entry whit get_the_content you loose all grammatical rules like full stop in the paragraphs, if you use it, the result is paragraph all mix together and that seems ugly.

  8. kurima May 6, 2011 at 6:54 am #

    Hi, been looking this code, however I need to remove second image on post instead of first image, so what code to remove second image?

    Thanks

    • Alvaro Neto May 6, 2011 at 8:23 pm #

      Hi Kurima, I can’t tell you now, But I’ll try to take a look asap and let you now.

  9. Potins December 7, 2012 at 12:56 am #

    hello , i use your function but sometimes i have this error :

    Warning: preg_replace() [function.preg-replace]: Unknown modifier ‘a’ in /var/www/potins.net/htdocs/wp-content/themes/celebritygossip-singlepro/functions.php on line 479

    exemple : http://www.potins.net/celebrites/marissa-mayer-elle-ne-lache-pas-yahoo-5280.html?preview=true&preview_id=5280&preview_nonce=f3bb99d32b

    • Alvaron December 11, 2012 at 4:51 am #

      Hi Potins, You’d better use get_the_content and get_the_post_thumbnail… after adding sizes to your theme… this function I’ve posted is old and for very specific cases. Hope it helps. Best Regards.

Leave a Reply

* Copy this password:

* Type or paste password here:

78,663 Spam Comments Blocked so far by Spam Free Wordpress

Powered by sweet Captcha

online casino
worldbookies