Title: code pasting not working
Last modified: August 22, 2016

---

# code pasting not working

 *  Resolved [revolutionaryhabit](https://wordpress.org/support/users/revolutionaryhabit/)
 * (@revolutionaryhabit)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/code-pasting-not-working/)
 * Hi there,
 * I’m a CSS beginner who’s having trouble finding which bit to paste in the code
   to the loop.
    I’ve looked at the WP Codex and have pasted in the code to the 
   index.php within the loop. Plugin is activated and the featured image has a caption
   in the meta box.
 * website is [http://www.revolutionaryhabit.com](http://www.revolutionaryhabit.com)
 * Still nothing shows up. Any ideas?
 * All help appreciated,
    S
 * [https://wordpress.org/plugins/featured-image-caption/](https://wordpress.org/plugins/featured-image-caption/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Author [Christiaan Conover](https://wordpress.org/support/users/cconover/)
 * (@cconover)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250715)
 * Can you post to [pastebin](http://pastebin.com/) the contents of the file where
   you pasted the plugin’s theme function?
 *  [avluis](https://wordpress.org/support/users/avluis/)
 * (@avluis)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250731)
 * I noticed op did not reply but for those interested, you do not even need to 
   place the code on your theme.
    I do not like advertising other plugins, but this
   two go together like peanut butter and jelly, or cookies and cream or bacon cheeseburger
   with peanut butter (if you are from that cult).
 * Anyways, plugin: [Post Snippets](https://wordpress.org/plugins/post-snippets/)
   by [Johan Steen](https://profiles.wordpress.org/artstorm/).
 * Once you have said plugin, got to its settings page, “Add New Snippet”, set a
   title for it (no spaces), check to enable Shortcode and PHP Code and add something
   like this on the Snippet window (modify as needed to fit your needs):
 * `echo "<p><i>Featured Image Credit: </i></p>"; cc_featured_image_caption(); echo"
   <hr />";`
 * This will create a snippet that can be inserted onto your posts right from the
   editor with the featured image caption included.
 *  [alihaag](https://wordpress.org/support/users/alihaag/)
 * (@alihaag)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250734)
 * [@avluis](https://wordpress.org/support/users/avluis/) that did the trick – thanks!
 *  [alihaag](https://wordpress.org/support/users/alihaag/)
 * (@alihaag)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250738)
 * I really like this plugin so far, and still would like to get it to work without
   using the Post Snippets plugin (though together, they did work nicely). I’m really
   frustrated that I’m not getting the installation correct.
 * I’m using the Twenty Fifteen theme. I’ve tried adding `<?php cc_featured_image_caption();?
   >` to index.php (in several places; I should be back to [the original index file](http://pastebin.com/yS75mjcb)
   now).
 * I have deactivated the Post Snippets plugin although the shortcode is still visible
   on [two](http://www.spookykitty.com/the-kitten-coop/) [posts](http://www.spookykitty.com/snow-no/).
   _Yo, don’t judge the content. This is my kid’s site._
 * Can you show me what I’m missing? Thanks much!
 *  Plugin Author [Christiaan Conover](https://wordpress.org/support/users/cconover/)
 * (@cconover)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250739)
 * You don’t really want to put it in `index.php` but in the appropriate `content-[
   posttype].php` file. Better yet, you should create a [child theme](http://codex.wordpress.org/Child_Themes)
   and modify the files where you’d like to use the code.
 * I am [planning to modify the way the plugin inserts the caption data](https://github.com/cconover/wp-featured-image-caption/issues/14)
   in the theme so that no code changes will be required. Hopefully I’ll have that
   taken care of soon.
 *  [alihaag](https://wordpress.org/support/users/alihaag/)
 * (@alihaag)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250740)
 * First of all, I want to thank you for responding so quickly!
    Also, I appreciate
   the reminder re child theme. I was so hot to solve this puzzle it had totally
   slipped my mind.
 * **(1)** So you’re saying I need to create a custom post template?
 * My confusion (still) lies in placing your one line of code. Even if I create 
   a CPT (in which I would be modifying index.php or single.php as for use in my
   child theme (?) I’m not sure; I’ve been working on that today. unsuccessfully.)**(
   2)** adding that line of code “within the loop” (ex: lines 31-39 of [parent/index.php](http://pastebin.com/PqQP13G1))
   would break the `<?php ... ?>` of lines 30-53?
 * I have tried placing your code in every rational place between the get_header&
   get_footer with no luck.
 * I appologize if this question is too basic. I’m new to the dark arts of WP. Thanks
   for your time.
 * _and thanks for putting this on your to-do list!_
 *  [avluis](https://wordpress.org/support/users/avluis/)
 * (@avluis)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250742)
 * If you are using the theme _Twenty Fifteen_ then that tells me you have the latest
   WordPress – which means that your WordPress install will contain different type
   of content pages where you could insert `<?php cc_featured_image_caption(); ?
   >`.
 * If you want to minimize the number of plugins WordPress is using, while taking
   advantage of this plugin – at least while the developer takes care of this automatically
   in a future update – you will need to make use of child themes.
    If you have 
   never created a child theme, there is a plugin that lets you create one based
   on your current theme. You then switch to your child theme and you are free to
   uninstall that plugin. From there, I recommend reading up on functions.php and
   how to filter content so you can add `<?php cc_featured_image_caption(); ?>` 
   dynamically. If you don’t care too much about that, then you can simply modify
   your child theme – look for php files that start with `content` in `wp-content
   > themes > your child theme`. If you open any of those content files, the first
   few lines, which are comments, will tell you what they do. So essentially, it
   all depends where you want your `<?php cc_featured_image_caption(); ?>` to be
   displayed. Good luck, and have fun learning more about the inner workings of 
   WordPress.
 *  [creativepassion](https://wordpress.org/support/users/creativepassion/)
 * (@creativepassion)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250744)
 * Worked for me Alihaag. I’m using a child of twentyfifteen.
 * After this (in content.php):
    `<header class="entry-header">`
 * I added this:
    `<?php cc_featured_image_caption(); ?>`
 *  [michi2009](https://wordpress.org/support/users/michi2009/)
 * (@michi2009)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250754)
 * Hi ,
    I installed the plugin and set the code with posts snippets ( as avluis
   told). It works now in this way, that when I right click on the image, I got 
   the appropriate information in grafik info.
 * But is it possible to show the information directly below or on the image all
   the time?
 * Thanks a lot in advance,
    Michi
 *  Plugin Author [Christiaan Conover](https://wordpress.org/support/users/cconover/)
 * (@cconover)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250757)
 * I’ve released version 0.5.0 which supports automatic caption insertion. This 
   should take care of what you’re looking to do with it.
 *  [michi2009](https://wordpress.org/support/users/michi2009/)
 * (@michi2009)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250758)
 * Hello Christiaan,
    sorry for late response. Works great now. Thanks a lot for
   your efforts and spend time. Thanks!
 *  Plugin Author [Christiaan Conover](https://wordpress.org/support/users/cconover/)
 * (@cconover)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250759)
 * Awesome! Thanks for the update.
 *  [daphnedelay](https://wordpress.org/support/users/daphnedelay/)
 * (@daphnedelay)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250760)
 * Hi Christian, I just found your plugin and it looks like it perfectly fits what
   I was looking for, but for some reason it won’t activate …?? I’ve deleted it 
   and re-uploaded it to my plugins folder 3 times. Any suggestions?
 * Thanks 🙂
 * [http://www.mirrorministries.org](http://www.mirrorministries.org)
 *  Plugin Author [Christiaan Conover](https://wordpress.org/support/users/cconover/)
 * (@cconover)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250761)
 * Daphne,
 * Would you mind creating a new thread for your issue? That way we can keep different
   issues separate. Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘code pasting not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/featured-image-caption_884578.svg)
 * [Featured Image Caption](https://wordpress.org/plugins/featured-image-caption/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/featured-image-caption/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/featured-image-caption/)
 * [Active Topics](https://wordpress.org/support/plugin/featured-image-caption/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/featured-image-caption/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/featured-image-caption/reviews/)

 * 14 replies
 * 7 participants
 * Last reply from: [Christiaan Conover](https://wordpress.org/support/users/cconover/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/code-pasting-not-working/#post-5250761)
 * Status: resolved