short code output too early

A shortcode has to return just a string, you should not print something like in wp_list_pages() or echo. From Shortcode API: The return value of a shortcode handler function is inserted into the post content output in place of the shortcode macro. Remember to use return and not echo – anything that is echoed will … Read more

shortcode change variable base on user

If this works for you in the template: $s=”[cfdb-table form=”Contact form 1″ show=”Submitted Login,your-email,your-message” search=”AndrewA”]”; echo do_shortcode($s); then you could try: global $current_user; get_currentuserinfo(); $s = sprintf(‘[cfdb-table form=”Contact form 1″ show=”Submitted Login,your-email,your-message” search=”%s”]’,$current_user->display_name); echo do_shortcode($s);

Changing layout of defaul gallery output to masonry

try it like this: $.each($(‘.gallery img’), function () { var rndmnum = Math.floor((Math.random()*11)+1); rndmnum = rndmnum *20 + 260; $(this).css({ ‘max-width’ : rndmnum }); }); note: untested sources: https://stackoverflow.com/questions/8904707/javascript-random-number-between-15-and-225-increments-of-30 https://stackoverflow.com/questions/8733838/random-max-width-for-each-image-on-a-page edit: corrected calculation

Custom shortcode that writes to file

Your code works for me on a development server. As is, it saves to the site root directory. My guess is that you are trying to write to a directory to which the server does not have write access. I would suggest saving to wp-content/uploads or some other directory where you should reasonably have write … Read more

load plugin with ajax [duplicate]

looking at the html output of the plugin code, i can say u that the plugin loads everything else (textarea and history) with javascript (see all those data- attributes and loading message). Now if the call to function was made on page load(non-ajaxy way), the plugin would have loaded requried javascript files and then things … Read more