« first day (1381 days earlier)      last day (3571 days later) » 

12:06 AM
have you tried another computer/proxy?
 
 
5 hours later…
5:04 AM
Hello all
Anybody here?
 
5:21 AM
Question : How to create ajax with wordpress and get response in javascript variable?
 
this is a very common question. did you try searching google?
 
and?
 
I found something but not understanding I am new in WP.
 
5:28 AM
Thanks but I have seen this.
I already have coded jquery with $.ajax I need responce in javascript variable. Need to change the code to wordpress ajax.
 
you always get the response on js variable under the success callback on $.ajax()
 
$.ajax directly work with wordpress??
 
yes.. why not
 
I am getting error about from googleapis jquery can not be included in wp.
 
also note you will need to send all ajax request to http://mysite.com/wp-admin/admin-ajax.php
 
5:37 AM
can you give me a simple example of jqurey ajax with wordpress
 
i see.. your problem is using jquery with WP, not ajax. basically you will need to do is
jQuery(document).ready(function($) {
    // Inside of this function, $() will work as an alias for jQuery()
    // and other libraries also using $ will not be accessible under this shortcut
});
notice the $ on function()
$(document).ready() will not work
 
I need $.ajax too, it working with this code??
and it works with .php file or I need to create a .js file ??
Thanks for suggestions. Please reply about this.
@Sisir
 
$.ajax will work once you pass the $ via ready() function
i do not understand the second question..
 
this code works in PHP file?
inside <script> </script> <?php ?>
 
yes, it will but you have to make sure jquery file is added before the <script> tag. otherwise it will show jQuery undefined
 
5:50 AM
how to add this jquery file?
I think I am asking silly questions
 
google search for 'wordpress enqueue script'
 
wp_enqueue_script("jquery");
This one?
 
yes, but better you add your custom script via registering then enqueue. see examples
if you are new wp. You should start from codex. Take couple of hours to read.. always helps when you read documentations..
 
Ok, Thanks for help
 
 
1 hour later…
6:56 AM
hello
 
 
5 hours later…
11:49 AM
@Rarst is this meant to be the QP replacement from core guys?
 
Prefer QP
 
me too
 
yes
what do you prefer for my infromation?
 
@kaiser you are aware, both are written by Rarst?
 
yes
 
12:01 PM
much less of it in reference actually
 
"less of it in reference"?
 
less of being written by me
 
iirc you wrote the parser?
 
nope
 
what part then?
 
12:02 PM
@Rarst In short: Easier on the eye. Links to GitHub.
I like the "show source in full".
 
mostly merging pull requests, saying thank you, and otherwise being poster of giving a shit
 
hehe
 
you know in how short supply these things are in WP :)
 
@Rarst specifically searching. The spacing means the functions almost bleed into one another. The fact that syntax highlighting is used drags attention away from the function name.
I.e. queryposts.com/?s=cache vs developer.wordpress.org/… - QP has more data, yet its easier to take in.
 
12:18 PM
the wp developer reference isnt as polished/consistent
the alignment of widths is off on the main page, the archives look unfinished and have little context, with a super low information density
no search box on the archives, and query posts has the super handy autocompleting searchbox
also no 'similar functions'
 
12:35 PM
I agree, always use query posts because it link to github
 
 
2 hours later…
2:39 PM
 
2:54 PM
@toscho come one. give them a chance :D
 
3:44 PM
So ThemeForest elite theme and...
<?php
	if ( get_post_type() == 'post' )
	{
		get_template_part( 'single', 'post' );
	}
	elseif ( get_post_type() == 'portfolio' )
	{
		get_template_part( 'single', 'portfolio' );
	}
	elseif ( get_post_type() == 'gallery' )
	{
		get_template_part( 'single', 'gallery' );
	}
?>
that's in single.php
why.
 
omg I am a newbie and I would just create files called portfolio-single.php, gallery-single.php
why indeed
 
@mebu83 actually get_templart_part() will use single-gallery.php. The stupid thing is that portfolios and galleries will go straight to single-{post type}.php. All this does is white screen any other post type.
 
I am never doing any themeing without template inheritance again :) the amount of sanity it brings into the process is unbelievable
 
all you have to say is "themeforest"..
 
Well lessons learned (it's type-slug syntax, and no need to add elaborate clauses if you do it right)
 
4:23 PM
@StephenHarris get_template_part() will give you an error - missing argument ;)
 
@kaiser :P
 
 
2 hours later…
6:17 PM
seems Panda rush is over, WPSE traffic slightly down
 
 
1 hour later…
7:20 PM
btw on topic of WP references check out hookr.io current top dog pretty much
 
may I bother you guys with a totally random wp unrelated question?
but still coding related
 
just ask, saves time
 
I am modifying a slider to use in a wp site. The customer claims that he can see a clear change in the color of the image
more green, more yellow
did you guys ever encounter something like this?
 
had you measured if color is actually changing?
 
let me do that just now, brb
yes
it changed
 
7:40 PM
see, we had established client is not delusional :) now go google why the heck slider is doing that
 
will do, thanks for the clarity
 
if it's resized might be lossy recompression. if not might be overlay of some kind.
 
he said as well that in fullscreen it looks good
(already measuring that)
 
7:58 PM
@mebu83 check the color profile of the original and the resized version
 
both rgb, both 8 bits/ channel
 
what kind if rgb is the question :)
if the original is AdobeRGB and the resized version is sRGB you found the cause
 
I am pretty newbie, so I am sorry if you have to lead me to the answer, checking tha tright now
ok one is AdobeRGB
checking the other
I think that's it, an exif viewer determines one as AdobeRGB the other gives me "WARNING: No color-space metadata and no embedded color profile: Windows and Mac web browsers treat colors randomly."
I guess that's it
 
8:26 PM
@mebu83 can you see/check if the imagick (imagemagick) extension is available in your php version? phpinfo()?
 
of course, just a second
 
but it looks like it is not. no color space on the resized version indicates that GD is used. Imagemagick handles conversion much better..well i don't know how the wordpress imagick class handles it.
ok, it's not.
 
so without that extension, wordpress will always create slightly falsified colors when resizing
so the best cause of action would be to provide the images in srgb?
 
i guess the solution is to manually convert the color space on the original before it gets uploaded with photoshop or something similar
:)
 
imagick is pretty staple though
 
8:31 PM
well it's not wordpress it's GD which does it wrong
 
sorry you are right of course
askking the hoster to add the imagick extension wont happen how I see it
 
most of the time it's wordpress fault, this is an exception :)
 
LOL
 
@mebu83 why the heck not?..
 
8:36 PM
PHP Version 5.2.17
2
 
duuuude
run away?
 
time machine
why do so many hoster apparently refuse to update their stuff?
 
why is is that everytime I try to edit wordpress the host is using an old ass version of php - fuk that
 
updating risks ancient shit code breaking and costing money, not upgrading costs nothing
 
it's possible to server different versions
 
8:40 PM
almost all German hosters offer 5.5 now, even the shitty ones
 
and let the client decide, no voodoo
 
obscure sagat house music quote ^ don't think anyone got it
 
clients don't care. those who do would never touch host running 5.2 in first place
 
good point
 
@rarst I thought changing php extensions would affect all of the installed clients on at least that vServer
 
8:41 PM
many huge shared hosts are actually owned by the same shit company , google Endurance International Group
 
if WP cut off 5.2 we would see hilarious update rush, alas
@mebu83 it depends on how PHP is run. as Apache module yes, as CGI it's isolated (can even run multiple PHP versions for same account)
 
@rarst @ungestaltbar I should run away, indeed! Well I have one client that runs 5.1.x
 
this is not funny
 
the funny part is that the greater PHP community blames outdated hosting on wordpress and they are somewhat right
 
blame is too harsh, but definitely meek inaction
 
8:45 PM
risk management
 
bad service
 
right now WP is having a fit about PHP development accelerating. harder to claim "it's ok" about obsolete versions.
 
the risk of losing clients from breaking sites is far greater then gaining clients from php versions.
 
wonder what should break. wordpress has built-in cross compatibility to almost everything between 1990-2035
 
latest version does. plenty people also run outdated version of WP with worse compat to newer PHP.
 
8:50 PM
the api will free us all !
 
Our saviour?
 
our lord javascript
3
 
yeah my node/angular version of wordpress is almost done
 
it will really get harder to keep good face about PHP versions. 2011-2014 they been "only" one version behind from stable. now they are suddenly two, next spring they are three.
 
@ungestaltbar if that isn't a joke I am truly impressed
 
8:52 PM
doing chat's tag line right... :D
 
stop being impressed
 
stop being impressed, why?
 
see chat tag line
 
Where humor doesn't work
omg
Is there a reliable way to make you guys forget my blunder?
 
8:57 PM
Writing lol is not humor.
 
lol
 
I saw that coming
 
171 lol by @Rarst vs 0 lol by @toscho
I saw that coming
 
isn't it supposed to be the response to it
not so familiar with the "new" lingo though..
 
@userabuser has 505 lol
 
9:01 PM
how embarrassing
 
I'm pretty sure you even have a client side filter to not use words that contain lol in the middle of the word.
 
#WordPress Developers Organize Community Initiative to Standardize Custom Post Types, Taxonomies, and Metadata http://wp.me/pBMYe-74r
 
@kaiser Yes, I call it intelligence.
 
intelolgance
 
A smile is the jewelry of an idiot.
4
 
9:06 PM
one cite a day calendar?
 

« first day (1381 days earlier)      last day (3571 days later) »