Title: Messages for Users
Last modified: November 10, 2017

---

# Messages for Users

 *  Resolved [ciberdom](https://wordpress.org/support/users/ciberdom/)
 * (@ciberdom)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/messages-for-users/)
 * Hello!
 * Someone knows if it is possible to add text in products that only users can see.
   I just need to add a couple of lines but each product will have a different text.
 * Thanks in advance!!!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmessages-for-users%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [superkot](https://wordpress.org/support/users/superkot/)
 * (@superkot)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9671493)
 * Wordpress has built in .logged-in class name for that. You need to wrap your 
   text in a custom class that is invisible by default and visible for the logged
   in users.
 * In your product:
    `<span class="secretmessageforusers">Bla bla bla</span>`
 * In your CSS:
 *     ```
       .secretmessageforusers {display:none;}
       .logged-in .secretmessageforusers {display:block;}
       ```
   
 *  Thread Starter [ciberdom](https://wordpress.org/support/users/ciberdom/)
 * (@ciberdom)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9672646)
 * Wow !!!!!
    Fantastic help! Many thanks!!! I am surprised that it is something
   so simple, I have asked a lot about this issue and all the solutions were complicated
   or you had to install a plugin.
 * How can I place the text below the price?
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9673045)
 * Try this snippet:
 *     ```
       add_action( 'woocommerce_single_product_summary', 'my_custom_text', 25 );
       function my_custom_text() {
         print '<span class="secretmessageforusers">Bla bla bla</span>'.PHP_EOL;
       }
       ```
   
 * I am unable to test it with your theme.
 * You can use this plugin for snippets:
    [https://wordpress.org/plugins/my-custom-functions/](https://wordpress.org/plugins/my-custom-functions/)
 *  Thread Starter [ciberdom](https://wordpress.org/support/users/ciberdom/)
 * (@ciberdom)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9673943)
 * Thanks for the reply!
    The code did not work! Do I have to change some of the
   code you gave me to make it work? Regarding the plugin, I read that it is to 
   add code but I have not seen that it allows me to move the code that I have already
   added thanks to [@superkot](https://wordpress.org/support/users/superkot/) It
   is right?
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9674179)
 * I tested the code on my site and it worked. I was not able to test it with your
   theme because it is a commercial theme and I don’t have a copy. Its possible 
   that your theme uses different hooks.
 * The code I gave you is php and it goes at:
    Dashboard > Settings > PHP Inserter
   Ensure the “On” button is green on that page.
 * [@superkot](https://wordpress.org/support/users/superkot/) gave you some custom
   css, and this goes at:
    Dashboard > Appearance > Customise > Additional CSS
 * When you have it working, it will show the same text on every product page. Come
   back for how to have different text for different products.
 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [8 years, 6 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9728682)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.
 *  Thread Starter [ciberdom](https://wordpress.org/support/users/ciberdom/)
 * (@ciberdom)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9795555)
 * Hello everyone!
 * I am sorry for the delay in responding but I was doing tests and I have encountered
   a problem.
 * How can I make the text appear exclusively for a specific user role?
 * I’ve noticed that currently any user who logs in can see the text but what I 
   want is that the text can only be seen by the “Partner” Users
 * It’s possible?

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

The topic ‘Messages for Users’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [users](https://wordpress.org/support/topic-tag/users/)

 * 7 replies
 * 4 participants
 * Last reply from: [ciberdom](https://wordpress.org/support/users/ciberdom/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/messages-for-users/#post-9795555)
 * Status: resolved