Argh didn't even saw this was the testers list but the solution is to do add_action for 'wp_head' en then loop the main query.
Marko Op 18 dec. 2012, om 19:29 heeft Chip Bennett <[email protected]> het volgende geschreven: > Maybe move this over to WP-Hackers, or WPSE? It's an interesting question, > and I have some ideas, but probably has moved out-of-scope for WP-Testers. > > > On Tue, Dec 18, 2012 at 1:28 PM, Philip M. Hofer (Frumph) <[email protected] >> wrote: > >> .. just need to implement a way to add to the wp_head whenever a post is >> found, that's all ... I'll keep looking. >> >> eof. >> >> >> >> -----Original Message----- From: Marko Heijnen >> Sent: Tuesday, December 18, 2012 10:22 AM >> >> To: [email protected].**com <[email protected]> >> Subject: Re: [wp-testers] add_action anonymous function >> >> The example to adding a meta tag to wp_head. >> >> It seems like you want to 'fire' the action inside your loop. That can't >> be done. You need to do all your add_action/add_filter inside functions.php >> and not in a theme file. >> >> >> Op 18 dec. 2012, om 19:19 heeft "Philip M. Hofer \(Frumph\)" < >> [email protected]> het volgende geschreven: >> >> .. what example? .. the one I wrote earlier that was in the codex ? >>> (before you removed it) >>> >>> >>> >>> >>> -----Original Message----- From: Marko Heijnen >>> Sent: Tuesday, December 18, 2012 10:16 AM >>> To: [email protected].**com <[email protected]> >>> Subject: Re: [wp-testers] add_action anonymous function >>> >>> It really depends on your implementation. and your example seems wrong. >>> You need on add_action( 'wp_head', 'some_function' ); >>> Inside that function is your code. >>> >>> Marko >>> >>> >>> Op 18 dec. 2012, om 19:14 heeft "Philip M. Hofer \(Frumph\)" < >>> [email protected]> het volgende geschreven: >>> >>> Is there a way to fire add_action on a function that happens multiple >>>> times ? >>>> >>>> usage, for example is adding a meta tag to wp_head each and every post >>>> that is displayed >>>> >>>> >>>> -----Original Message----- From: Marko Heijnen >>>> Sent: Tuesday, December 18, 2012 10:07 AM >>>> To: [email protected].**com <[email protected]> >>>> Subject: Re: [wp-testers] add_action anonymous function >>>> >>>> The use of an anonymous function is bad code practice and I removed that >>>> part of the codex. Another reason it required PHP 5.3 >>>> >>>> The reason it fails it probably due an old PHP version. >>>> >>>> Marko >>>> >>>> >>>> Op 18 dec. 2012, om 18:59 heeft Léonard Wüst <[email protected]> het >>>> volgende geschreven: >>>> >>>> bitte meine adresse löschen danke >>>>> >>>>> 2012/12/18 Philip M. Hofer (Frumph) <[email protected]> >>>>> >>>>> Taken from the add_action codex http://codex.wordpress.org/** >>>>>> Function_Reference/add_action#****Simple_Hook<http://codex.** >>>>>> wordpress.org/Function_**Reference/add_action#Simple_**Hook<http://codex.wordpress.org/Function_Reference/add_action#Simple_Hook> >>>>>>> >>>>>> >>>>>> add_action('wp_head', function() { echo 'something';}) >>>>>> >>>>>> is supposed to work, it just makes my site die >>>>>> >>>>>> >>>>>> ______________________________****_________________ >>>>>> wp-testers mailing list >>>>>> [email protected].****com >>>>>> <[email protected].**com<[email protected]> >>>>>>> >>>>>> http://lists.automattic.com/****mailman/listinfo/wp-testers<http://lists.automattic.com/**mailman/listinfo/wp-testers> >>>>>> <ht**tp://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> mit freundlichen grüssen aus sursee >>>>> léonard wüst, oberstadt 10, 6210 sursee >>>>> onlinedienstleistungen, mediaservice >>>>> preisgünstige professionelle homepages, journalismus >>>>> >>>>> www.leonardwuest.ch >>>>> www.innerschweizonline.ch >>>>> www.bochumer-zeitung.net >>>>> ______________________________**_________________ >>>>> wp-testers mailing list >>>>> [email protected].**com <[email protected]> >>>>> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>>>> >>>> >>>> ______________________________**_________________ >>>> wp-testers mailing list >>>> [email protected].**com <[email protected]> >>>> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>>> ______________________________**_________________ >>>> wp-testers mailing list >>>> [email protected].**com <[email protected]> >>>> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>>> >>> >>> ______________________________**_________________ >>> wp-testers mailing list >>> [email protected].**com <[email protected]> >>> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>> ______________________________**_________________ >>> wp-testers mailing list >>> [email protected].**com <[email protected]> >>> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >>> >> >> ______________________________**_________________ >> wp-testers mailing list >> [email protected].**com <[email protected]> >> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >> ______________________________**_________________ >> wp-testers mailing list >> [email protected].**com <[email protected]> >> http://lists.automattic.com/**mailman/listinfo/wp-testers<http://lists.automattic.com/mailman/listinfo/wp-testers> >> > _______________________________________________ > wp-testers mailing list > [email protected] > http://lists.automattic.com/mailman/listinfo/wp-testers _______________________________________________ wp-testers mailing list [email protected] http://lists.automattic.com/mailman/listinfo/wp-testers
