I want to add some html under the title of a custom post type I created. See area in image here:
http://i.stack.imgur.com/rpkV3.png
I tried using different methods including post_row_actions (depricated) filter to do this. Does anyone know of a function or a method on how to do this? I was hoping to use an action hook or filter. I want to add a simple with some instructions and maybe an image to that area.
Thanks
You could do this by adding a notice, they appear in that spot.
Something like this would add a notice just for pages. You would obviously need to adjust the if statement for your CPT and to show on what pages you want.
You could easily add an image or whatever else you want and style it by the
custom-notice
class.And technically…
Of course you could use JS but if you just wanted to add a bit of text, you could even just use CSS. I know this won’t be a popular solution, but it is an option 🙂
For example, creating an admin stylesheet and adding the following would add text under the Pages title. Just adjust the class
post-type-page
You can do this with a filter, but you have to do something you generally should not do–
echo
content from a filter.That filter is not meant to be used as in the code above. It is pure chance that it is located where it need to be to pull that off, and I would not consider it stable or reliable. But it can be done.
You probably do want to consider a Javascript solution.