Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2324 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Removing class from the_post_thumbnail

Thread title: Removing class from the_post_thumbnail
Reply    
    Thread tools Search this thread Display Modes  
03-08-2011, 12:22 AM
#1
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old  Removing class from the_post_thumbnail

PHP Code:
//remove class from the_post_thumbnail
function the_post_thumbnail_remove_class($output) {
    
$output preg_replace('` class="(.*?)"`'''$output);
    return 
$output;
}
add_filter('the_post_thumbnail''the_post_thumbnail_remove_class'); 
This is racking my brains. Can you see anything wrong with my code? It doesn't work.

Reply With Quote
03-08-2011, 02:17 AM
#2
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

Is there an error?

Reply With Quote
03-08-2011, 02:27 AM
#3
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

It chucks no error. Just doesn't work. Strange. :/

Reply With Quote
03-08-2011, 02:46 AM
#4
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Why are those ticks (`) there?

Reply With Quote
03-08-2011, 04:45 PM
#5
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

No idea. It belonged to some default WP code which I had edited.

Anywho, I managed to get what I wanted to achieve through a different method.

Thanks though.

Reply With Quote
Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed