wp3678
Forum Replies Created
-
Forum: Requests and Feedback
In reply to: Add a wp_list_archives filterwp_list_pages isn’t a filter. It’s a function/template tag.
No it is a filter see the Filter Reference page.
http://codex.wordpress.org/Plugin_API/Filter_Reference
Basically the problem is there is a filter for pages, a filter for categories but there is NO filter for archives which seems very strange.
I am suggesting could one be added or is there a workaround?
Forum: Requests and Feedback
In reply to: Add a wp_list_archives filterNo that does not seem to work
add_filter(“wp_get_archives”,”testme”);
The function testme does not appear to be executed?
add_filter(“wp_list_archives”,”testme”) does not work also.
Any other ideas?
TIA
Forum: Plugins
In reply to: Should get_posts(“category__and=1,2”) work?Probably many ways of doing this but the PHP explode() function does the job (converts a string to array).
`$args = array(
‘numberposts’ => 5,
‘category__and’ => explode(“,”,”1,2″);
);
$theposts = get_posts($args);`Forum: Plugins
In reply to: How do you send in HTML as ShortCode parameter?Simple when you know how wp_specialchars_decode
Forum: Plugins
In reply to: Should get_posts(“category__and=1,2”) work?Many thanks that does work in isolation but I think my problem is actually with trying to parametrize the 1,2 bit.
In the get_posts example it uses examples like:
$myposts = get_posts('numberposts=5&offset=1&category=1');This means the 5, 1, 1 in the criteria string can easily be built up into to appropriate string to be sent into get_posts.
Can the category__and option be made to work like that or do I need to do something else to build up a string?
The following (obviously?) do not work for me is what I need possible?
$myposts = get_posts('category_and=1,2');
$myposts = get_posts('category_and=array(1,2)');
$myposts = get_posts('category_and=>array(1,2)');TIA
Forum: Fixing WordPress
In reply to: Output List Of Posts From Category On A Page?Answering my own question again but the following URL has an example on how to detect page http://wordpress.org/support/topic/125439?replies=9
Forum: Fixing WordPress
In reply to: Output List Of Posts From Category On A Page?Got this virtually sorted now.
Does anyone know how to limit the execution of some code to a specific page? e.g. if pageid=1 then dothis1 elseif pageid=2 then dothis2 else dothis3.
The original code snippet by jbrndt is missing the following line at the end.
<?php $wp_query = $temp_query; ?>Thanks
Forum: Fixing WordPress
In reply to: Output List Of Posts From Category On A Page?I have inserted the below code in my existing page.php just after the <?php the content…..> line. I am using the Default theme (WordPress v2.5.1)
This half works as a list of the posts from the category are output but then the full text of the first post in the list is output and then a full list of the posts from the category again repeated until the browser hangs/slows and you need to press the stop button.
Can anyone help further and tell me how to fix the problem?
Thanks
<?php query_posts('category_name=mycatname&showposts=109'); ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <ul><li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li></ul> <?php endwhile; ?>