Title: fcalloni's Replies | WordPress.org

---

# fcalloni

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] Change reCAPTCHA badge position](https://wordpress.org/support/topic/change-recaptcha-badge-position/)
 *  [fcalloni](https://wordpress.org/support/users/fcalloni/)
 * (@fcalloni)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/change-recaptcha-badge-position/page/3/#post-11153819)
 * For anyone looking for a different solution for this, involves changing the recaptcha.
   php module for the plugin though but gives more flexibility I believe.
 * There are two function in the module that need to be edited:
 *     ```
       function wpcf7_recaptcha_enqueue_scripts() {
         $service = WPCF7_RECAPTCHA::get_instance();
   
         if ( ! $service->is_active() ) {
           return;
         }
   
         $url = add_query_arg(
           array(
             // 'render' => $service->get_sitekey(),
             'render' => 'explicit' // Render the widget explicitly, needed if setting grecaptcha.render parameters
           ),
           'https://www.google.com/recaptcha/api.js'
         );
   
         wp_enqueue_script( 'google-recaptcha', $url, array(), '3.0', true );
       }
       ```
   
 * and
 *     ```
       function wpcf7_recaptcha_onload_script() {
         $service = WPCF7_RECAPTCHA::get_instance();
   
         if ( ! $service->is_active() ) {
           return;
         }
   
         if ( ! wp_script_is( 'google-recaptcha', 'done' ) ) {
           return;
         }
   
       ?>
       <script type="text/javascript">
       ( function( grecaptcha, sitekey ) {
         var wpcf7recaptcha = {
           clientId: null,
   
           render: function() {
             this.clientId = grecaptcha.render(
               'google-recaptcha',
               {
                 'badge' : 'bottomleft',
                 'sitekey' : sitekey,
                 'size' : 'invisible'
               }
             );
           },
   
           execute: function() {
             grecaptcha.execute(
               // sitekey,
               this.clientId, // use client ID returned by grecaptcha.render instead.
               { action: 'homepage' }
             ).then( function( token ) {
               var forms = document.getElementsByTagName( 'form' );
   
               for ( var i = 0; i < forms.length; i++ ) {
                 var fields = forms[ i ].getElementsByTagName( 'input' );
   
                 for ( var j = 0; j < fields.length; j++ ) {
                   var field = fields[ j ];
   
                   if ( 'g-recaptcha-response' === field.getAttribute( 'name' ) ) {
                     field.setAttribute( 'value', token );
                     break;
                   }
                 }
               }
             } );
           }
         };
   
         //grecaptcha.ready( wpcf7recaptcha.execute );
         grecaptcha.ready( function() {
           wpcf7recaptcha.render();
           wpcf7recaptcha.execute();
         } );
   
         document.addEventListener( 'wpcf7submit', wpcf7recaptcha.execute, false );
   
       } )( grecaptcha, '<?php echo esc_js( $service->get_sitekey() ); ?>' );
       </script>
       <?php
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PHPEnkoder] Problem after Update from 1.11 to 1.12](https://wordpress.org/support/topic/problem-after-update-from-111-to-112/)
 *  [fcalloni](https://wordpress.org/support/users/fcalloni/)
 * (@fcalloni)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/problem-after-update-from-111-to-112/#post-4505567)
 * Had same problem and what fixed for me was to edit the line 438 from:
 * `$ord = unpack("N",$c)[1];`
 * to:
 *     ```
       $ord = unpack("N",$c);
       $ord = $ord[1];
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Custom Post Type Parent](https://wordpress.org/support/topic/custom-post-type-parent/)
 *  [fcalloni](https://wordpress.org/support/users/fcalloni/)
 * (@fcalloni)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/custom-post-type-parent/#post-1563542)
 * > i am having a similar problem with my CPT aswell,
   >  but my issue is that how
   > do i separate the normal blog posts and CPT i have hunted the net for solutions
   > but can not find any
 * hi syrus69, to show only your custom posts create a page (i.e. page-artwork.php
   my case) and set your own WP_Query – have a code like this on the page:
 *     ```
       <?php
       $type = 'sf1_artist';
       $args=array(
         'post_type' => $type,
         'post_status' => 'publish',
         'paged' => $paged,
         'posts_per_page' => 4,
         'caller_get_posts'=> 1
       );
       $temp = $wp_query;  // assign orginal query to temp variable for later use
       $wp_query = null;
       $wp_query = new WP_Query($args); 
   
       get_template_part( 'loop', 'artists' );
       ?>
       ```
   
 * for more info check these:
    [http://codex.wordpress.org/Function_Reference/WP_Query](http://codex.wordpress.org/Function_Reference/WP_Query)
   [http://codex.wordpress.org/The_Loop](http://codex.wordpress.org/The_Loop)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Custom Post Type Parent](https://wordpress.org/support/topic/custom-post-type-parent/)
 *  [fcalloni](https://wordpress.org/support/users/fcalloni/)
 * (@fcalloni)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/custom-post-type-parent/#post-1563529)
 * I too have the same problem and couldn’t find anything to help.
 * As a dirty, temporary solution (hope someone finds one!) I’ve used javascript
   and jQuery to change the selected menu item, hope it helps 😉
 *     ```
       <!-- Dirty hack to change current menu item (current_page_parent) -->
       <script type="text/javascript" language="javascript">
       $(document).ready( function (){
   
       	// change this with the menu ID which SHOULDN'T be selected.
       	var temp = $('#menu-item-34').attr('class');
   
       	// removes 'current_page_parent' class from current selected menu item.
       	temp = temp.replace("current_page_parent ", "");
       	$('#menu-item-34').attr('class', temp);
   
       	// change this with the menu ID which SHOULD be selected.
       	temp = $('#menu-item-43').attr('class');
   
       	// adds 'current_page_parent' class to desired menu item.
       	temp = "current_page_parent " + temp;
       	$('#menu-item-43').attr('class',temp);
   
       });
       </script>
       ```
   

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