« first day (956 days earlier)      last day (4287 days later) » 

07:11
I need a separate custom template for only one blogpost
Is it a good idea to split it like this:
<?php $post = $wp_query->post;
if ( is_single('17'); ) {
include(TEMPLATEPATH . '/single-custom.php');
} else {
include(TEMPLATEPATH . '/single-normal.php');
}
?>
Or am I going to hell if there are a lot of custom templates for single blogpost?
// find 'single-17.php'
add_filter( 'single_template', function( $template ){
	if ( $special = locate_template( 'single-' . $GLOBALS['post']->ID, FALSE ) )
		return $special;
	return $template;
});
@Sven Look at wp-includes/template-loader.php to find the proper hook.
@toscho Thx :)
@Sven that could be a question for the main site …
07:26
@toscho Okay, I'll post it in a couple of minutes ;)
08:14
looks like they are starting to take docs more seriously with a prelude survey, wordpressdotorg.polldaddy.com/s/documentation-survey perhaps a change is in the wings...
08:28
@userabuser It does indeed look like some changes are coming make.wordpress.org/docs
cool...
^ I think that is fairly new ^
still being built
@toscho Did you see that single_template filter has been deprecated? codex.wordpress.org/Plugin_API/Filter_Reference/single_template
@Sven That information is wrong.
Codex … sigh
@toscho It's not deprecated?
08:39
no, it isn’t
In fact, it cannot, because it is a result of {$type}_template.
@toscho Okay :)
@toscho Sorry, just read it in the Codes :/
Never trust the Codex, always read the source code first.
3
there, fixed
08:46
@bungeshea Add that page to your watch list. The last time I fixed something someone removed it and added the wrong code back.
@bungeshea yep this is new... in progress
09:11
Find Iron Man:
@bungeshea eurgh black text on a medium dark blue
@toscho already done
09:40
hi... anyone can help me?
@Smart with what?
how i can customize article title from some category
anu
anu
@SmartShovon ask a question on the main site
Best to post more info about your problem and what you've tried so far on the main site
09:43
add_filter( 'the_title', function( $title, $id ) {
	if ( in_category( 'your_categoryname', $id ) )
		return 'custom title';

	return $title;
});
> 200 of 1,172 support threads in the last two months have been resolved.
dot org has it even worse than we do with woocommerce...
@toscho i want from some category not all category...
@SmartShovon That’s exactly what my sample code does.
anu
anu
lol
09:48
@toscho such stuff is so much nicer with atomic hooks...
@toscho where i imput this code? if this category is like news . it's show like "category : news" . i want it show only chain tune
@SmartShovon I strongly suggest you read up on what filters and actions are
if you have to ask that question, then you dont grasp the basic concept and shouldn't be using filters/actions
@TomJNowell ok. can but can you tell me where i imput this code? function.php or archive.php
again, failure to grasp basic concept
imagine you have a list of tasks
09:56
1: arrive at supermarket
2: pick up bread
3: pick up milk
4: pick up butter
5: pay
Now imagine Toscho gives you this new step, but doesnt tell you where to put it:
?: if somebody hands you an item, put a mark on your list
where does it go?
do you do it between 2 and 3?
4 and 5?
no, because it's a nonsense question
you'll want it to happen early because if you put it between 2 and 3, you dont mark off the bread
but toscho might have given you it in the car, at home, at the supermarket entrance, the carpark, last tuesday in a bar, it wouldnt matter
10:25
days since Tom's metaphor binge killed the chat: 0
:)
indeed
I wouldn't consider that chat
not after you spoke
@toscho you can thank me later
in other news, someone edited my query_posts codex entry modification to call pre_get_posts an action instead of a filter
I will. Watch your rep melting away.
10:30
to be clear - not that I am against it :) always entertaining
it's like art - you don't talk back to art :)
anu
anu
almost dada-esque
dada-esque?
10:59
There was a digital bank named "Liberty Reserve", which had their own currency named LR. They "cleaned" money for one million users. Money that came from child porn and drugs - according to news papers. They shut it down today.
11:21
anonymous banking is always going to have money laundering and child pornographers involved, not because they're the people who set it up, but because it's incredibly attractive and useful to those kinds of people
For the same reason your blog has people posting about Xanax, free essays and viagra
> according to newspapers.
not my words
@kaiser haha
11:38
we need a tagline one main. to say "this is not where you go when you don't want to pay for support"
12:17
hmmm was I wrong to post a js snippet that could bring down a question askers server here? wordpress.stackexchange.com/questions/101133/wp-mail-very-slow
what's up with Facebook questions today...
@TomJNowell upvoted for bringing down server
I also turned the analogy into a blog post tomjn.com/356/where-do-i-put-that-code
@ALL How many people visit your blog in ~one month?
@kaiser 15K, lost traffic on ongoing hiatus...
12:32
thanks for the benchmark :)
in the last month, ~500
I showed you mine now show me yours
Slowly recovering. Currently at ~1.5k á month.
close to non existing :)
12:57
threw local code tools (code sniffer, mess detector, phing, etc) into composer project. sooo much better
no git mess, all scripts in vendor/bin and just working...
refresh whole pack with composer update --no-dev instead of figuring out what has new versions
13:35
@Rarst can we see said composer.json?
{
	"name"   : "rarst/code-tools",
	"require": {
		"phpmd/phpmd"              : "*",
		"phing/phing"              : "*",
		"squizlabs/php_codesniffer": "*"
	}
}
@TomJNowell If you need a perfect link: here it is
14:05
added
fucking brain dead today...
Some people see a problem and think "I know, I'll use Java!" Now they have a ProblemFactory. source
@kaiser you're not alone
14:30
0
A: PHP Install SSH2 on Windows machine

Alex BProbably you already solved it, but here's how I did it - maybe will help someone else: 1) Downloaded Win32 SSH2 PECL extension from this location (choose the appropriate version); 2) Extracted the archive's content and: - placed php_ssh2.dll and php_ssh2.pdb files in the "ext" (e.g c:\php\ext)...

dammit... so. close.
14:49
power to the Singleton
15:48
I has ssh in phing!
16:13
Just got a mail from a guy who took care of a cat that my brother rescued out of a gully. It died today at age 16.
did? died?
died.
solid age... mine is also a rescue, about 12 years old now
finely wasted middle of the day on updating local stack... have to do some times :)
only xdebug is being sluggish now :\
16:23
movie2k gone?
what?
@kaiser no
thanks. just accidently clicked quick link and wondered as I read something about kino.to guy jailed.
17:02
anyone on win and has latest PHP plus xdebug?
what you need?
how slow it is? I updated stuff and now 100ms WP load becomes 300ms with xdebug enabled
Can't tell. Whole computer is pretty slow overhere. GPU or hard disk problem.
doesn't matter that computer is slow, I am interested in difference with and without xdebug
Sorry, but got too much work in front of me to start measuring micro time.
17:16
ok :) install Laps some time :) less work then
Got laps installed. Lots of empty space because of waiting for hard disk or whatever.
18:05
@TomJNowell Actually calling pre_get_posts an action, rather than filter, is not entirely incorrect: github.com/WordPress/WordPress/blob/3.5.1/wp-includes/… :)
Hi everyone :)
Do you know of a reliable math plugin that allows using LaTeX notation and allows the standard constructs, i.e. delimit inline math with $ ... $ and display with with \[ ... \] (or possibly $$ ... $$)?
Why delimit? What for? Please elaborate.
It should be $ ... $ and not $latex or [latex] or some such. I am willing to completely give up the ability to write $ signs
@kaiser Have you ever used LaTeX?
Nope.
If not, you probably can't answer this ...
If yes, it'll be clear from my question.
But thanks for looking :-)
18:13
@Szabolcs Not used any - but have you checked the repository?
@Szabolcs But not for a plugin recommendation - only if you find nothing and have to code it yourself or need assistance with adjusting a plugin.
@kaiser erm, plugin recommendation?
:)
@StephenHarris Yes, I tried a number of them in the past and each one had some problem. That's why I asked here this time. It's for a collaborative blog with several users who won't be happy to have to learn some inconvenient new notation (they all know LaTeX) and they will write a lot of formulae, usually several in each sentence.
@Szabolcs Also, why. If copying from latex file, you could just automatically replace them?
@Szabolcs I see - the problem being they required [latex] syntax?
@StephenHarris See above, and imagine writing serious maths. [latex] [/latex] just doesn't cut it.
18:16
> [latex] [/latex] just doesn't cut it
That's a non-sense sentence... specify your exact problem.
This [latex][/latex] is a shortcode. So it's from some plugin... QUestion #1: Which plugin?
@kaiser $ is used for any in-line equation of mathematical symbol. Its possible to replace it with shortcode, but it would be horrible to use....
@StephenHarris Ehm... what?
@StephenHarris it's a private blog for research collaborators, and I need to set it up and make it convenient. I can't really force people to deviate from what they are used to in LaTeX. I'll take another look at all the plugins I tried before. I remember that the one that worked well with just $...$ did not allow writing both display and inline math in the same post. I had to select if I want one or the other.
18:19
Yes, anything can be replaced by anything... don't get that point. Thought it's about using the [latex][/latex] shortcode annotation from some plugin...
@kaiser As I said, if you never worked with this, it would be difficult to understand the practicalities.
@kaiser In latex if you want to display an in-line equation, you would wrap it in`$`-signs. But most WP Plug-ins replace this syntax with shortcodes.
Still: What`s the problem?
Simple solution: jQuery
@kaiser Yes, or intercept the post between editor and database and convert dollar-signs into shortcodes. In the database, and front-end the post content contains the shortcodes. But whenever it reaches editor it uses dollar signs.
$( __TinyMCE-Selector__ ).keypress( "M",function(e) {
  if ( e.ctrlKey )
    console.log( 'CTRL+M was pressed - Mathblock shortcode added );
} );
$( __TinyMCE-Selector__ ).keypress( "I",function(e) {
  if ( e.ctrlKey )
    console.log( 'CTRL+I was pressed - Inlinemath shortcode added );
} );
I wouldn't think about using $ for the sake of convenience...
18:23
@Szaboic - my plug-in WP-MarkDown uses a similar idea: I wanted HTML in the database, but MarkDown in the editor. You could do something similar: Hack existing latex plug-in. In the editor user enters dollar signs, when its saved they are converted to shortcodes. When a post is edited, shortcodes are converted to dollar signs.
Just use an easy to use shortcode that isn't used by the browser. Then insert [$][/$] for the inline math or whatever for the other math. Not completely sure if a [$] shortcode will work, but if not, simply replace it by [s][/s] will look close enough to people can live with it.
I like the Mathjax-Latex plugin, but it doesn't allow for the standard latex syntax
Build you own. Use the MarkDown plugin by @StephenHarris as blueprint.
anu
anu
18:42
@Szabolcs I don't think there is one, I ended up using Mathjax-latex and using the shortcodes.
However, I don't see why you couldn't write a little plugin that filtered the content before the Mathjax-latex runs, and converts $$ to [latex]
Or: Trigger the insertion of the shortcode with the above: jQuery.keypress()...
@anu Simply because I am not that familiar with either PHP or WordPress and I have plenty to do ... it would be fun to spend two days to play with it and figure it out, I just can't. But I appreciate the information you gave me, I may just quit looking for plugins.
@ALL Could it be that I cant' add more than one callback to wp_ajax_{$action}?
anu
anu
@Szabolcs I've been doing some work for Nature. I'm not aware of a Latex plugin that doesn't require you to use a shortcode
18:52
Hm. Seems like I can register multiple callbacks to wp_ajax_(nopriv_)*, but only the first one gets executed... is this true?
@anu It seems that MathJax-LaTeX allows all of $$, \[ and \(, and they have the same meaning as in LaTeX. But is does not allow $. Also if I could completely disable the visual editor somehow, that would solve plenty of problems. Do you know if it's possible to allow $ with MathJax-LaTeX instead of \( and whether it's possible to disable the visual editor?
Ah, I have to run out, busy day .. I'll be back in 20 min
Where can I get WordPress crack or keygen?
7
anu
anu
LOL
Genius!
You just got popular.
anu
anu
@Szabolcs I think if you can use the $$ syntax, then you have to force the plugin to load for the page:
"However, if this is the only syntax used, the plugin must be explicitly told to load mathjax for the current page. This can be achieved by adding a [mathjax] shortcode anywhere in the post. "
There are a few plugins to disable the visual editor eg wordpress.org/plugins/disable-visual-editor-wysiwyg
18:58
@Szabolcs Ooooh! Shiny stars!
Meanwhile in the Justice Hall...: is there any advantage in disabling apache from interpreting .htacess? I have posted a question on security.SE but maybe you guys could give me a hand:
0
Q: Does disabling .htaccess improve security?

ruda.almeidaI have a new WordPress website that has been installed on a server not managed by me. Its admin has enforced a few rules in order to increase security, I'm not entirely aware of its entirety but it includes: Placing apache's www folder in a separate, noexec partition Running apache as a user wi...

@ruda.almeida security not really, speed slightly
@Wyck Do I lose anything apart from the "pretty permalinks"?
@ruda.almeida you don't loose anything if you're using a configuration file, .htacess is a directory file (like a child of a conf file).
though wordpress will not be able to write to it
@kaiser Depends. Its common for callbacks to exit(). If so, no :)
19:07
@ruda.almeida but why would you not want to use it to begin with unless you're concerned with millisecond speed increases
@Wyck Hmm, so I can move its directives into an "hierarchically higher" conf file?
@kaiser Not checked, but doesn't sound right. Thats just an action like any other....
@Wyck Sysadmin implemented some security measures and disabling .htacess is one of them (more details here: security.stackexchange.com/questions/36641/… )
You're sysadmin is probably an idoit
19:09
@Wyck Might be the case. He is also a web designer fond of iframes.
@ruda.almeida web designer ≠ sys admin, anyhow you can read about it here, httpd.apache.org/docs/2.2
@StephenHarris I have an abstract base class, that forces each extending class to have its own ajax_cb()-method. They're all registered, but when I dump __CLASS__ in the callback, I always get back the first one registered. And it doesn't make any difference if I register the action to the wp_ajax_ hook from abstract or parent class.
@ruda.almeida yep, moving rules to actual Apache config. it's preferable for performance, but too inconvenient for anyone to actually bother with it :)
and has nothing to do with security hehe, I'd like to hear why he thinks .htaccess is not secure
19:40
@kaiser What happens if you dump the filters global?
@StephenHarris I see all callbacks attached.
@kaiser And there's nothing in the callback preventing the rest from being executed?
Stupid question :/
Nope.
Got a var_dump( __FUNCTION__ ); present in every ajax_cb() - only the first one triggers.
Maybe dump everything in do_action to find out why its not reaching / skipping the callbacks. AFIK there is no special treatment for wp_ajax_* hooks.
I even changed the priority for the first hook - no difference.
thing is driving me crazy
19:49
@kaiser build small abstracted example, reproducing it, dump into gist
@Rarst small abstract example is a bit tough. multiple links triggering multiple callbacks, js switch...
thus why small and abstract. if you can reproduce it - it's easier to narrow down issue. if you can't reproduce it - you might not have full understanding of what is going wrong and what are possible reasons it's going bonkers
interesting - zend opcode is indeed noticeably faster than apc
apc 110ms, zend 80ms
trying to
20:18
> It’s not just a matter of polish, it seems to be a fundamental issue with the concept.
no shit...
ha
> the result just isn’t compelling, or obvious, or any of the things that it should be.
that itself was obvious like 6 months + ago, no offense to MJ I do like him
easy to say from sidelines... :)
but it is indeed deeply troubled feature from the start
I think post formats is one of those cases when "decision, not options" mantra met "one size doesn't freaking fit all" common sense
I agree it's not easy from his position, there was tons of support for them , including from the inner circle, but in the end you have to make a decision, it might have taken a bit to long imo but at least it's done
akak it will be part of jetpack and put into .com
20:29
hehe
@Rarst @StephenHarris @Wyck Here's the obscurity with WP_AJAX molded into a plugin. HOW-TO: Just open a template that has a loop. It should add two links to each post named UNO and DUE. Click one of them, inspect the admin-ajax.php result. It will always be the class name of the first class; ChildClassUNO.
If anyone has an explanation for that: Please explain me where the heck I wasted the last two hours...
@kaiser Erm, exit?
what?
@kaiser doesn't that kill everything (except shutdown/ object deconstructors)?
You have to use either die(); or exit; in the callback.
@kaiser Well yes, but that's to kill processing and send stuff back to the client. In fact I don't think its necessary since WP calls it after its triggered the actions (in case no callback was triggered).
Anyway, if you exit in the first it won't reach the second.
20:45
@StephenHarris Hmmm... what do you suggest? I got an undefined amount of such extending classes. One for each user action, so I don't know when to exit
@kaiser Have you tried not exiting? WP should kills everything after: github.com/WordPress/WordPress/blob/3.5.1/wp-admin/…. Though the 0 might upset things....
@StephenHarris You must call exit in your AJAX callback.
@kaiser If you have a class which you know will run (or in fact, in all of them) attach a second callback with higher priority and exit in that
Or is that lower priority? Higher number anyway....
actions are supposed to have unique handler
@Rarst what?
why?
20:49
well, more logically than technologically.
if you want to stack handlers on one action it's becoming a mess
@Rarst Yup, the second handler is a bit of an ugly hack - but having multiple classes hook onto the same action is fine.
So it's either a bug or a LARGE drawback...
@kaiser Its not a bug...
@kaiser in the base class you could hook onto WP ajax hook and trigger a custom one. The base class handles the exit...
yeah, it's just your problem how to robustly implement multiple things stacked
@toscho why must? it dies anyway right after
@StephenHarris Could you show me an example? Fork of Gist?
20:52
@Rarst but with output
@kaiser Your classes then hook onto native custom hook. Actually you could just have a second method called by the base class I think...
@kaiser hook once, do custom apply_filters(), hook your multiple things into your custom filter
@toscho ah, yeah 0...
@StephenHarris I hadn't looked close at what he is doing :) action for sequential things, filter for modifying thing... as usual
@Rarst Filter isn't for modifying things. apply_filters() = markup, nothing else
21:00
well, whatever fits... same thing inside, semantic difference :)
@Rarst take a look at the code. Filter is just output. That one doesn't matter. Could as well just echo it.
@StephenHarris Doesn't work. No response.
@kaiser Updated it to make sure the exit callback is fired later. Part from that I've just move the exit call to the base class...
@kaiser cooking :)
@Rarst okok. fully understand that.
@StephenHarris Did it - doesn't work. Throws a bunch of errors at me as it immediately triggers all other callbacks and then the data isn't set... fuuuuuuuuuuck it!
@kaiser I meant to ask, the hook doesn't pass any data to the callbacks. You get that from $_POST/$_GET
21:15
I know. Do get the post ID from there. But now all callbacks are running when I click one link. I'm doing post meta data and user meta data updates in the callbacks. Not cool - especially not because I got different links to toggle states. Example: Fav a post for a user - or unfav it... still everything is fuuuuuuuuuuucked up!
I am so glad Justin Tadlock released his post format blocker, and I didn’t. :)
How can I add the author name to the bottom of each post? Does it require editing the template file or is there a setting I missed?
21:37
@Szabolcs See here
 
1 hour later…
22:59
oh, movie2k.to seems to be gone now.
@toscho I assume you won't close it as a duplicate then, right?
@Szabolcs I am not aware of a dupe. You should search first. :)
@toscho I did search, but the only things I find is "add this and that to the template", without indicating which template file, and I still find it hard to believe that this is not a standard feature. All I'd like is a bit of guidance so I can have this done and move on to something more productive.
Sorry
I'm a bit fed up with the whole setting up a blog task
There are two ways to do that: in your template or as a filter on the_content.
@toscho which one is the template file? some posts tell me to add it to loop-single.php, but I don't see such a file. Also unfortunately I don't have ssh access to I can't just grep. I have to use the builtin editor.
23:04
single.php
@toscho Every post has a line like this at the bottom: "This entry was posted in Uncategorized on 2013-05-29". I assume I need to modify this line and add the_author();. But this line is not present in single.php
depends on your theme
Twenty Eleven: content-single.php, Twenty Ten and Twelve: functions.php.
I have a plain twenty-twelve, and in functions.php I see 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.' Do you have any idea why I only get This entry was posted in Uncategorized on 2013-05-29. without any "by" line? Is there any other place this could be defined? Maybe the person who set up the blog (university-set-up, supposedly vanilla wordpress 3.5.1) messed up something?
figured out where time before plugins is going... seems to be mostly default-filters.php
must be hidden by the css I guess
23:30
(Also, I know just enough German to be endlessly, ENDLESSLY amused by the "pfui" shorthand for Post Formats UI)
hehe
some parts of core load should really be just compiled into flat PHP code :\

« first day (956 days earlier)      last day (4287 days later) »