Okay
  Public Ticket #1602130
Shortcode function in "normal" portfolio layout
Closed

Comments

  • Theron started the conversation

    This, I think, is similar to PUBLIC TICKET #1372431

    I'm am attempting to use several shortcode options in my portfolio (layout type "Normal"). 

    The shortcodes I'd like to use are:

    • tabs
    • toggle
    • image group (with all fading directions)
    • technology box

    I tried my hand and manipulating the scripts.js file as offered in the previous mentioned ticket number but obviously the circumstances are different and my js coding knowledge is still only at the basic copy/paste level.

    Any help is greatly appreciated!

  •  1,974
    Support replied

    Hi Theron, add your shortcodes in the portfolio content and then sens wp admin credentials in a private comment with access to Appearance -> Editor and we will try to help you.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Theron replied

    I appreciate the support. Because this is a live site, I don't feel comfortable with that approach. Is there another way we might approach this?

  •  1,974
    Support replied

    I see. You can do the changes I suggest (or someone else from your side), but they need to be tested and make sure everything is in order.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Theron replied

    Yes, thank you. I am fine making edits and testing as needed. I can send you copies of the .js files or any other file if that is helpful in making sure the code get's placed in the right location, etc.

  • Theron replied

    Also, I should mention that I have the shortcodes added to the portfolio section that I am using but I have that section set to "popup image" layout type as a place holder. When I want to test the code I can toggle that over to "normal", hard refresh, test and then toggle back so there is little interruption in service. This is how I've been testing so far and, because I don't have a huge traffic load, I'm fine with the brief interruptions that may result from this testing approach.

  •  1,974
    Support replied

    Hi,

    We can only make suggestions of what code should be moved around. 

    Otherwise, we can do it for a fee, as a change request / custom work. 

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Theron replied

    Ok, thank you. It should mostly be a matter of moving the code around, correct? Based off the solution offered in TICKET #1372431 I assumed this was a quick fix. I'm happy to make any edits required and will seek further assistance if needed.

  • Theron replied

    What causes the javascript to not function within the portfolio sections?

  •  1,974
    Support replied

    The shortcode need to be initialised after ajax loading. html code is loaded from the server and then after, the browser will have to execute the js code

    to give you an example. Assuming you re running 2.3:

    if you open /js/scripts.js, go to line 992 and there you will see //Init Scripts Here

    That's where you need javascript initialisation to be copied.

    For example if you need a toggle you would insert there

    // Toggle
    jQuery(".toggle_container").hide(); 
    jQuery("span.toggle-title").click(function(){
    jQuery(this).toggleClass("toggle-active").next().slideToggle("normal");
    return false; 
    });

    Which is exactly the initialisation when the pages loads normally.



    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •   Theron replied privately
  •   Theron replied privately
  •   Theron replied privately
  • Theron replied

    Alright, everything appears to be working properly after adding the code except one small error when I activate the lowest toggle within the profile section:


    TypeError: ($.fn.appear.checks[length]) is not a function. (In '($.fn.appear.checks[length])()', '($.fn.appear.checks[length])' is undefined)

    This is from the /js/appear.js line 126:

       //keep a queue of appearance checks
        $.extend($.fn.appear, {

            checks: [],
            timeout: null,

            //process the queue
            checkAll: function() {
                var length = $.fn.appear.checks.length;
                if (length > 0) while (length--) ($.fn.appear.checks[length])();
            },

    It appears to me that it is a confusion between the script that slides down the profile content and the script that activates that last toggle. Should there be something that clears the values of the queue after the toggle script?

    Any help is appreciated.