Title: Tom Morton's Replies | WordPress.org

---

# Tom Morton

  [  ](https://wordpress.org/support/users/tm3909/)

 *   [Profile](https://wordpress.org/support/users/tm3909/)
 *   [Topics Started](https://wordpress.org/support/users/tm3909/topics/)
 *   [Replies Created](https://wordpress.org/support/users/tm3909/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/tm3909/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/tm3909/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/tm3909/engagements/)
 *   [Favorites](https://wordpress.org/support/users/tm3909/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 404 total)

1 [2](https://wordpress.org/support/users/tm3909/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/tm3909/replies/page/3/?output_format=md)…
[25](https://wordpress.org/support/users/tm3909/replies/page/25/?output_format=md)
[26](https://wordpress.org/support/users/tm3909/replies/page/26/?output_format=md)
[27](https://wordpress.org/support/users/tm3909/replies/page/27/?output_format=md)
[→](https://wordpress.org/support/users/tm3909/replies/page/2/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [pretty permalink is invalid show 404 page.](https://wordpress.org/support/topic/pretty-permalink-is-invalid-show-404-page/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/pretty-permalink-is-invalid-show-404-page/#post-9598586)
 * +1 Thanks [@pothi](https://wordpress.org/support/users/pothi/)!
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Hide meta if empty](https://wordpress.org/support/topic/hide-meta-if-empty/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hide-meta-if-empty/#post-9598475)
 * Miran,
 * Glad I could help! Be sure to mark the thread as resolved so the administrators
   know your question was answered.
 * Tom
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Hide meta if empty](https://wordpress.org/support/topic/hide-meta-if-empty/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hide-meta-if-empty/#post-9598147)
 * Miran,
 * You’re definitely on the right track, but need a few tweaks:
 *     ```
       <?php 
       if ( ! empty( get_field( 'lieu' ) ) ) {
       	echo '<span class="element-fiche-technique">Montant DH</span><span class="info-fiche-technique">'.get_field("lieu").'</span>';
       }
       ?>
       ```
   
    - Be careful when using ‘ and “. You need to make sure they’re standard quotes
      and not curly quotes.
    - You used `echo` and then tried to output PHP (`<?php the_field() ?>`). When
      you are inside PHP, which is anything between `<?php and ?>` you should not
      wrap your PHP code.
    - You are outputting HTML, and you can embed the PHP function inside it by ending
      the string (I use a single quote and then a dot to concatenate the PHP function
      get_field).
    - Finally, remember the function `the_field` automatically echo’s out the value.
      In your case, you are already using echo, so you want to return the value 
      by using `get_field`.
 * Hope this helps. For further reading, I definitely recommend running through 
   the W3Schools PHP5 Syntax and basics course. It’s quick and will really help 
   in these situations.
 * [https://www.w3schools.com/php/php_syntax.asp](https://www.w3schools.com/php/php_syntax.asp)
 * Good luck!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [A plugin that auto inserts code into the theme Header.php file?](https://wordpress.org/support/topic/a-plugin-that-auto-inserts-code-into-the-theme-header-php-file/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/a-plugin-that-auto-inserts-code-into-the-theme-header-php-file/#post-9598048)
 * [@zopfan](https://wordpress.org/support/users/zopfan/),
 * The `wp_head` action would be your best bet, and you could create a quick plugin
   that does what you need, but it sounds like you’d like this feature without having
   to write any code.
 * I did some quick searching and found [https://wordpress.org/plugins/header-footer/](https://wordpress.org/plugins/header-footer/).
   Not sure if this is the same plugin you are referencing (and if it is, my apologies)
   but it seems to hook into `wp_head` and `wp_footer` to insert the code you post
   inside the options panel.
 * Note: I haven’t used this plugin. Always backup your site before installing something
   new.
 * Hope this helps!
    Tom
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [pretty permalink is invalid show 404 page.](https://wordpress.org/support/topic/pretty-permalink-is-invalid-show-404-page/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/pretty-permalink-is-invalid-show-404-page/#post-9598034)
 * [@bearshang](https://wordpress.org/support/users/bearshang/),
 * Nginx can be tricky when configuring for WordPress. WordPress expects apache 
   and so it loads permalink settings into a hidden file inside the root HTML directory
   called `.htaccess`. This file contains settings for Apache to use, including 
   how to redirect based on your sites permalinks.
 * With Nginx, however, you’ll need to do this inside your Nginx configuration. 
   I’m unsure where the config lives on Centos, but look somewhere inside of /etc/
   nginx/. Be sure to edit your **site** settings, not global Nginx config.
 * You’ll need to pass along the location and redirection settings to the file, 
   similar to this:
 *     ```
       location / {
           index index.php index.html index.htm;
           try_files $uri $uri/ /index.php?$args;
       }
       ```
   
 * Check the sources below for a bit more detailed information. I would also recommend
   following the WordPress.org Nginx link for more configuration options.
 * Sources:
    -  [https://codex.wordpress.org/Nginx](https://codex.wordpress.org/Nginx)
    - [http://nginxlibrary.com/wordpress-permalinks/](http://nginxlibrary.com/wordpress-permalinks/)
 * Hope this helps and let me know if you have any follow up questions!
 * Tom
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Hide meta if empty](https://wordpress.org/support/topic/hide-meta-if-empty/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/hide-meta-if-empty/#post-9598015)
 * Miran,
 * I see you are using a function called “the_field”, which comes from Advanced 
   Custom Fields. I’m assuming you are using that plugin (but please confirm).
 * If you need to check if the meta value exists, you can use the following code:
 *     ```
       <?php
       if ( empty( get_field('montant-dh') ) ) {
       	echo "vide"; //value is empty
       } else {
       	echo "pas vide";
       }
       ?>
       ```
   
 * A few notes:
    1. Using “the_field” echo’s the value, which outputs it to the screen. When working
       with if statements, you want to return the value, which allows you to review
       it. In your case, you want to return the value to the empty() function to see
       if it’s available.
    2. In your code, you used square brackets `[]` instead of parenthesis `()`. Anytime
       you are calling a function you should use the format `function_name(parameters)`.
    3. Be sure to use the code above inside of the loop. The function `get_field` is
       anticipating the post_id will be provided. If you aren’t running it in the loop,
       you can use this: `get_field('montant-dh', INSERT_POST_ID)` (you should place
       the post id inside the function where I put the placeholder.
 * If you have any questions don’t hesitate to ask.
    Tom
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] The woocommerce_get_shop_coupon_data filter](https://wordpress.org/support/topic/the-woocommerce_get_shop_coupon_data-filter/)
 *  [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/the-woocommerce_get_shop_coupon_data-filter/#post-4630630)
 * Not sure if you already found the answer, but I was able to find this:
 * [https://github.com/julliersq/karmakiss/blob/b9b02cfd4637e8d4e42986e2874a39443db08890/SourceFiles/wp-content/plugins/woocommerce-points-and-rewards/classes/class-wc-points-rewards-discount.php](https://github.com/julliersq/karmakiss/blob/b9b02cfd4637e8d4e42986e2874a39443db08890/SourceFiles/wp-content/plugins/woocommerce-points-and-rewards/classes/class-wc-points-rewards-discount.php)
 * Helped a great deal! Hope it helps you.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] Pinterest Pin It Button Loading Issue](https://wordpress.org/support/topic/pinterest-pin-it-button-loading-issue/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/pinterest-pin-it-button-loading-issue/#post-4525477)
 * Sorry to hear you both are having issues.
 * Have you updated the plugin or WordPress recently?
 * Tonny, can you post a link to your site so I can see it working live?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] Local language](https://wordpress.org/support/topic/local-language-1/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/local-language-1/#post-4583784)
 * Sorry for the delay.
 * Can you submit a link to where this is happening? I’d like to take a look at 
   your site.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] Formatting issue](https://wordpress.org/support/topic/formatting-issue-11/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/formatting-issue-11/#post-4495619)
 * Mark,
 * Sorry for the delay.
 * Try adding #main rather than .entry-content:
 *     ```
       #main .wpsocialite.small .twitter-follow.socialite-loaded {
       width: 260px;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] Disable WPSocialite on Specific Posts or Pages](https://wordpress.org/support/topic/disable-wpsocialite-on-specific-posts-or-pages/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/disable-wpsocialite-on-specific-posts-or-pages/#post-4340659)
 * Jeremy,
 * There is a way, but it would involve placing wpsocialite into the template directly.
   Is that a method you’re comfortable with or would you rather see a button on 
   each post/page that says “do not show wpsocialite”? Let me know your thoughts.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] WPSocialite conflict with Responsive design](https://wordpress.org/support/topic/wpsocialite-conflict-with-responsibe-design/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wpsocialite-conflict-with-responsibe-design/#post-4327249)
 * Valleyjays,
 * Are you still experiencing this issue? I’m going to mark this as resolved for
   now. Let me know if you’re still having trouble.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] How to wp_enqueue socialite.pinterest.js](https://wordpress.org/support/topic/how-to-wp_enqueue-socialitepinterestjs/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/how-to-wp_enqueue-socialitepinterestjs/#post-4323546)
 * You will need to re-enqueue pinterest as well as wpsocialite.js
 * So when you load wpsocialite.js, you need to also load extensions/extension.pinterest.
   js
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] Problem with facebook dialogue box](https://wordpress.org/support/topic/problem-with-facebook-dialogue-box/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/problem-with-facebook-dialogue-box/#post-4288480)
 * Sorry for the issues and delay. Incorporating the fix into the next release.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WPSocialite] Dutch translation completed!](https://wordpress.org/support/topic/dutch-translation-completed/)
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/dutch-translation-completed/#post-4432394)
 * Melroy,
 * Sorry for the late reply! Is there any way you can include this in a Git branch
   over at our github page? If not, I’ll include it manually and make sure to mention
   you in the log.
 * Let me know if its possible.

Viewing 15 replies - 1 through 15 (of 404 total)

1 [2](https://wordpress.org/support/users/tm3909/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/tm3909/replies/page/3/?output_format=md)…
[25](https://wordpress.org/support/users/tm3909/replies/page/25/?output_format=md)
[26](https://wordpress.org/support/users/tm3909/replies/page/26/?output_format=md)
[27](https://wordpress.org/support/users/tm3909/replies/page/27/?output_format=md)
[→](https://wordpress.org/support/users/tm3909/replies/page/2/?output_format=md)