Title: Joms's Replies | WordPress.org

---

# Joms

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

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

 Search replies:

## Forum Replies Created

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

1 [2](https://wordpress.org/support/users/jomsky/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/jomsky/replies/page/3/?output_format=md)…
[9](https://wordpress.org/support/users/jomsky/replies/page/9/?output_format=md)
[10](https://wordpress.org/support/users/jomsky/replies/page/10/?output_format=md)
[11](https://wordpress.org/support/users/jomsky/replies/page/11/?output_format=md)
[→](https://wordpress.org/support/users/jomsky/replies/page/2/?output_format=md)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Automatically add CPT category as Nav menu sub item](https://wordpress.org/support/topic/automatically-add-cpt-category-as-nav-menu-sub-item/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/automatically-add-cpt-category-as-nav-menu-sub-item/#post-13143510)
 * You can use the `wp_nav_menu_objects` filter. Try this (haven’t tested it yet):
 *     ```
          add_filter( 'wp_nav_menu_objects', 'wpg2byt_add_term_parent' );
           function wpg2byt_add_term_parent( $items ) {
             $terms = get_terms( array(
               'taxonomy' => 'project',
               'hide_empty' => false,
            ) );
   
             foreach ($terms as $term) {
             //format its data to be compatible with the filter
             $link = array (
                   'title'            =>  $term->name,
                   'menu_item_parent' => //id of the parent menu,
                   'ID'               => '',
                   'db_id'            => '',
                   'url'              => get_term_link($term)
               );
             $items[] = (object) $link;
             }
             return $items;    
           }
       ```
   
    -  This reply was modified 5 years, 10 months ago by [Joms](https://wordpress.org/support/users/jomsky/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to edit mobile version](https://wordpress.org/support/topic/how-to-edit-mobile-version/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/how-to-edit-mobile-version/#post-13143467)
 * Just looking at the markup of the footer, it consists of two separate menus and
   the space is intended for a title much like the other menus in the footer. So
   you either need to combine the two menus so there won’t be a space, or add a 
   title for the second menu. Where to do this depends on the theme – I suggest 
   starting at the [Widgets](https://wordpress.org/support/article/wordpress-widgets/)
   or the [Menu](https://codex.wordpress.org/WordPress_Menu_User_Guide) itself.
    -  This reply was modified 5 years, 10 months ago by [Joms](https://wordpress.org/support/users/jomsky/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Race conditions for a unique post_title](https://wordpress.org/support/topic/race-conditions-for-a-unique-post_title/)
 *  Thread Starter [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/race-conditions-for-a-unique-post_title/#post-12011078)
 * It’s actually an insert post:
 * So I have a generate_invoice_number() function that has this query:
 *     ```
       $max = $wpdb->get_var
               (
                   'SELECT MAX(cast(post_title as unsigned)) AS max FROM ' . $wpdb->prefix .'posts AS po
                    WHERE po.post_status IN ("paid", "unpaid", "expired", "credit") AND po.post_type = "' . PPY_INVOICE_PT .'"'
               );
       // code to generate the number based on the max value
       ```
   
 * And then use it like this:
 *     ```
       $number =  $this->generate_invoice_number();
        $post = array(
       		'post_title' => $number,
       		'post_type' => $post_type,
       		'post_status' => $status
       		);
        $new_post_id = wp_insert_post($post);
       ```
   
 * This works fine until the API that we use charges our users simultaneously (through
   automatic payments) and so the duplicate issue happens. This is due to multiple
   executions to the script that may run the select query before another insert 
   has happened.
    -  This reply was modified 6 years, 7 months ago by [Joms](https://wordpress.org/support/users/jomsky/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Beautiful taxonomy filters] How to Edit Taxonomy Label for Multiple taxonomy?](https://wordpress.org/support/topic/how-to-edit-taxonomy-label-for-multiple-taxonomy/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-taxonomy-label-for-multiple-taxonomy/#post-11419992)
 * Add the taxonomy parameter to your function.
 *     ```
       function modify_labels( $label,$taxonomy ){
          if ( $taxonomy == 'YOUR TAXONOMY HERE' ) {
             $label = 'New label' 
          }
          return $label;
       }
       add_filter('beautiful_filters_taxonomy_label', 'modify_labels', 10, 2);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WCFM - Frontend Manager for WooCommerce] Localization issue](https://wordpress.org/support/topic/localization-issue-13/)
 *  Thread Starter [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/localization-issue-13/#post-11263017)
 * Thanks, the way it works though is that the first language file that’s loaded
   will override the succeeding ones. It’s also right there in the top comment of
   your method 🙂
 * That’s why I suggested `load_plugin_textdomain` since it has a builtin logic 
   to check the languages directory first –
 *     ```
           // Try to load from the languages directory first.
           if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) {
               return true;
           }
   
           if ( false !== $plugin_rel_path ) {
               $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
           } elseif ( false !== $deprecated ) {
               _deprecated_argument( __FUNCTION__, '2.7.0' );
               $path = ABSPATH . trim( $deprecated, '/' );
           } else {
               $path = WP_PLUGIN_DIR;
           }
       ```
   
 * Cheers
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WCFM Membership - WooCommerce Memberships for Multivendor Marketplace] Limit Product/Category Access](https://wordpress.org/support/topic/limit-product-category-access/)
 *  Thread Starter [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/limit-product-category-access/#post-11062762)
 * Yes thank you but isn’t that just for vendors and shop managers? What about buyers?
   For example a buyer with a Pro membership can buy products that are under the
   Pro category.
 * Is that possible with the addon or do we need to use a different WooCommerce 
   plugin for that purpose?
 * P.S. I see in the video tutorial that there is a field for Categories, but I 
   think that’s only for when vendors are creating their products right?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Instead of theme thumbnails only blank squares](https://wordpress.org/support/topic/instead-of-theme-thumbnails-only-blank-squares/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/instead-of-theme-thumbnails-only-blank-squares/#post-9915699)
 * Are you using a multilingual plugin? Or do you have 2 separate WordPress installs
   for each of the languages?
 * Because it seems like you installed WordPress on
    `www.dietetykwlondynie.co.uk/
   en`
 * But your Home and Site URL are set to
    `www.dietetykwlondynie.co.uk` (as seen
   on where your stylesheet and images link to)
 * Try updating them by following the instructions here: [https://codex.wordpress.org/Changing_The_Site_URL](https://codex.wordpress.org/Changing_The_Site_URL)`
    -  This reply was modified 8 years, 3 months ago by [Joms](https://wordpress.org/support/users/jomsky/).
      Reason: Added possible solution
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Trying to work out how to speed up my site.](https://wordpress.org/support/topic/trying-to-work-out-how-to-speed-up-my-site/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/trying-to-work-out-how-to-speed-up-my-site/#post-7622127)
 * Your website takes more than 3MB of resources on first load. You are right that
   the main culprit is the background image that takes around 2.1MB. There’s no 
   amount of caching that could fix it on a new user visiting your website because
   the browser has to download the image first.
 * Suggestions:
    – You can minimize the size of the image considerably by optimizing
   it for web use. I just tried it in Photoshop using “Save for Web” and I removed
   50% of the file size. – Change the image to a repeating background image. You
   may need a designer for this. Basically you use a smaller image that will be 
   repeated to fill the background instead of using a single large image.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [The webside looks strage](https://wordpress.org/support/topic/the-webside-looks-strage/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/the-webside-looks-strage/#post-7622118)
 * Your website’s site URL still points to the .se domain. Since you can no longer
   login in the admin you will have to update it via FTP or directly into the database.
 * Here’s a guide on how to update the site url:
    [https://codex.wordpress.org/Changing_The_Site_URL](https://codex.wordpress.org/Changing_The_Site_URL)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How do I Add Google Analytics Code to my Blog?](https://wordpress.org/support/topic/how-do-i-add-google-analytics-code-to-my-blog/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/how-do-i-add-google-analytics-code-to-my-blog/#post-7474262)
 * The easiest way is to install an analytics plugin like this one: [https://wordpress.org/plugins/google-analytics-for-wordpress/](https://wordpress.org/plugins/google-analytics-for-wordpress/)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Root out hidden comments?](https://wordpress.org/support/topic/root-out-hidden-comments/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/root-out-hidden-comments/#post-7127116)
 * For your Google problem, you can request for a malware review. Follow this guide:
   [https://support.google.com/webmasters/answer/168328?hl=en](https://support.google.com/webmasters/answer/168328?hl=en)
 * As for the wrong comment count it’s probably caused by a comment plugin that 
   messed with the total amount of comments in your database. Try the fix here: 
   [http://beerpla.net/2010/03/21/how-to-diagnose-and-fix-incorrect-post-comment-counts-in-wordpress/](http://beerpla.net/2010/03/21/how-to-diagnose-and-fix-incorrect-post-comment-counts-in-wordpress/)
 * The SQL query that you’d want to run (where ‘wordpress’ is your database name):
 *     ```
       UPDATE wordpress.wp_posts wpp
       LEFT JOIN
       (SELECT comment_post_id AS c_post_id, count(*) AS cnt FROM wordpress.wp_comments
        WHERE comment_approved = 1 GROUP BY comment_post_id) wpc
       ON wpp.id=wpc.c_post_id
       SET wpp.comment_count=wpc.cnt
       WHERE wpp.post_type IN ('post', 'page')
             AND (wpp.comment_count!=wpc.cnt OR (wpp.comment_count != 0 AND wpc.cnt IS NULL))
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [My website shows up when you search my name and location, and I need it gone!](https://wordpress.org/support/topic/my-website-shows-up-when-you-search-my-name-and-location-and-i-need-it-gone/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/my-website-shows-up-when-you-search-my-name-and-location-and-i-need-it-gone/#post-7109553)
 * This should help to re-index your website: [https://support.google.com/webmasters/answer/6065812?hl=en](https://support.google.com/webmasters/answer/6065812?hl=en)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Turn off Caching](https://wordpress.org/support/topic/turn-off-caching/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/turn-off-caching/#post-7105836)
 * > Unfortunately some of my customers are still seeing these errors.
 * If the errors are only happening to your users can you try logging out as admin?
   You can also try creating a new user with the subscriber role or whatever the
   users with problems are assigned to. This could be an existing error and not 
   because of caching. Might be worth looking into 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Turn off Caching](https://wordpress.org/support/topic/turn-off-caching/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/turn-off-caching/#post-7105827)
 * No you should never edit WordPress core files. WP Cache shouldn’t give you any
   problems. Do you have a caching plugin installed? Or maybe there’s a server-side
   caching plugin in your hosting provider?
 * You can follow this guide: [https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens](https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wp-includes/pluggable.php on line 1228 Blank Login](https://wordpress.org/support/topic/wp-includespluggablephp-on-line-1228-blank-login/)
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wp-includespluggablephp-on-line-1228-blank-login/#post-7105337)
 * The most likely scenario is a plugin / theme issue. Try to remember the last 
   thing that you were working on before the problem manifested. A failed WP automatic
   update could also be the culprit.
 * You can follow the troubleshooting tips here: [https://codex.wordpress.org/Common_WordPress_Errors](https://codex.wordpress.org/Common_WordPress_Errors)

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

1 [2](https://wordpress.org/support/users/jomsky/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/jomsky/replies/page/3/?output_format=md)…
[9](https://wordpress.org/support/users/jomsky/replies/page/9/?output_format=md)
[10](https://wordpress.org/support/users/jomsky/replies/page/10/?output_format=md)
[11](https://wordpress.org/support/users/jomsky/replies/page/11/?output_format=md)
[→](https://wordpress.org/support/users/jomsky/replies/page/2/?output_format=md)