-1

First of all, I apologize for my English, because my English isn't good.

I want to automatically put image title(not caption) above the inserted image in content area.

Like this:

< h3 >Image Title< /h3 >
< img src="abc.jpg" >

How do i make it?

OR

How can i call image title variable in wp-includes/media.php file?

1 Answer 1

0

There's many ways to achive these. If you know php than you can do regular expression to find in text images and insert title before theme , but you need to write it somewhere to pull from like <img src=".." title="My title" /> and then in php find , take title="" and insert before image in the_content filter for ex. Seccond way is preaty much like first ( you need to write title="My title" ), but insted of php use jquery on frontend, for ex. u have container for content .conteiner then u do next $( '.conteiner img' ).each( function() { $(this).insertBefore( '<h3>' + $(this).attr( 'title' ) + '</h3>' ); } ):

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.