Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m having the same issue with adding a repeatable field. In my case the console stated there was an unexpected ; in or near jQuery.

    The event function in scripts.js of the simple-fields plugin requests the field group (repeatable field) from the server using a XHR post request. The respons data has a very confusing line of code in it

    if ( ( tinymce.DOM.hasClass( wrapper, 'tmce-active' ) || ! tinyMCEPreInit.qtInit.hasOwnProperty( edId ) ) &amp:&amp: ! init.wp_skip_init ) {

    I asumed that the &amp:&amp: in the middle of the if statement was the culprit so I added replace('&amp:&amp:','&&') on line 415 in the simple-fields scripts.js which solved the problem.

    (Because this forum editor converts any attempt of writing the entity name of ampersand into ampersands I have replaced the comma with a colon in the code above.)

    Editing the plugin is of course not ideal but in my opinion better than editing WP core files.

    Thread Starter tscok

    (@tscok)

    Okay, I found this to be working:

    function arphabet_widgets_init() {
      $args = array(
        'name' => __('Sidebar %d'),
        'id' => "sidebar".$i,
        'before_widget' => '',
        'after_widget' => '',
        'before_title' => '<h4>',
        'after_title' => '</h4>'
      );
      register_sidebars(3, $args);
    }
    add_action( 'widgets_init', 'arphabet_widgets_init' );

    The main difference is how you apply the ID 'id' => "sidebar".$i,. I tried different ways but found this way to be the best.

    I also removed the last comma, after the closing </h4>. Only because there are no further key/value pairs in the array.

    Finally I slapped on the __() function on “name” since it is some kind of alias function of translate(). I guess it can’t hurt to have it there although I don’t know what good it does.

    So, that’s it. I hope this thread can be of help to someone else.

    Maybe the image you are trying to upload is too big for the quota. Or WP have some internal limit on image sizes.

    To clarify what Phil means. This would be the header HTML:

    <header>
      <h1>Your title</h1>
      <div class="advertclass"><!-- // Ad content --></div>
    </header>

    Then use a modification of Phil’s CSS example:

    h1 {
      display: inline;
      float: left;
    }
    .advertclass {
     float: right;
    }
    Thread Starter tscok

    (@tscok)

    Another thing worth pointing out is that the ‘$i’ varible used in 'id' => "sidebar-$i", is actually adding ‘-‘ before any number. So if you follow the example code in the Function Reference you’ll end up with an ID that looks like sidebar--n where n is the ID numbering.

    Thus, “sidebar$i” will give you the proper ID, namely sidebar-n.

    IMO this should be pointed out the the Function Reference’s parameter description:

    id - Sidebar id. (Note: "-$i" is added automatically to supplied 'id' value after the first; e.g., "Sidebar", "Sidebar-2", "Sidebar-3", etc.)

    This is all very confusing. Is there something buggy about the function reference or am I just unlucky?

    Thread Starter tscok

    (@tscok)

    I tried the double quotes but I’m not sure it helped 🙁

    When I wrap the sidebar name in the sprintf() function I still get the correct number of sidebars but they all end with 0 (zero). And the original problem persists: the sidebar content disappears on page (wp-admin/widgets.php) reload.

    After reading the Function Reference, under Parameters it describes “name” as such:

    name - Sidebar name. (Note: If copying from default usage above, remove sprintf( ) wrapper function.)

    This made me think that maybe I should’ve left out the sprintf() function when copying the code to my functions.php file.. or maybe my English isn’t good enough 🙁

    Just a side note: I’ve seen many examples of how to add multiple sidebars using the singular register_sidebar() function multiple times. However, since there is a register_sidebars() function to use for multiple registrations, that function should be used. Otherwise I just don’t see the point of having this function.

    When I run your site in Chrome with Developer Tools I get a total of 28 errors(!) 🙂

    The first problem seem to be a missing CSS file under /plugins/nextgen-gallery/

    After that you seem to have a problem with Facebook login:
    FB.getLoginStatus() called before calling FB.init().

    And after that there’s a whole bunch of errors likely to concern jQuery.

    I’m no expert but if anything of the above ring a bell you might want to start troubleshooting those things first.

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