doing individual categories is already working, so I know how to get all posts from one cat and sort it by month, I need to know how to get all the posts from december and sort them by category.
Hope I made sense and that someone can give me a hand, cheers!
]]>I mean that on the left of the page I have a navigation/posts schedule calendar and after I click on the element of navigation the page is scrolled to the posts from a defined period of time. So:
2013
And then I immediately scroll to area where posts from eg. March 2013 are displayed
How could I do that? Does anyone have an idea?
]]>< ?php get_archives('','','option', 1); ?>
where that last param in the get_archives function puzzled me much, i check the syntax of it within web and i don’t find anything to explain the last param, can anyone figure it out for me ?Thanks!
]]>January 2012 (7)
December 2011 (2)
etc..
I have tried pretty much every suggestion so far on this forum on this subject but with no luck s yet. This article did manage to get the list itself to appear correct but when the links were clicked, archives from all categories appeared again! I imagine that’s down to WP not being able to differentiate between archive categories when also dividing into months.
I was wondering whether if the archive.php page within my theme could be made to filter only 1 category’s results?
Anyways, any advise or suggestions would be most welcome!
Many thanks in advance.
]]>This is my site: https://www.martinhult.com/om-mis and the thing I’m trying to edit is the ‘get_archives’ function.
Any help is much appreciated!
]]>https://www.brunswickcrossing.com/wordpress/?page_id=599
on the right side there are links to archived blogs by month. 2 of these months (may and april of 2011) are not linking to the correct archive page, but the rest of the months link correctly. The link goes to my main archive.php page where there is an in_category switch to draw the correct page based on content (blog or news) and a catch all archive page. For some reason, these two months are linking to the catch all archive page, even though the category seems to be correct in the dashboard.
I know the Kwebble “Archives for a category” plugin is installed, but I dont know if it is actually being used as I did not do the development on this site. Can anyone shed some light on why these particular posts are (apparently) tagged with the wrong category? Please let me know what other info may be required to solve this riddle. Thanks in advance!
]]>I’ve searched and google the issue and got various recommendations but all seem to include all Custom Post Types to the date based Archives, where as I only need a specific Post Type to show when calling the wp_get_archives function.
So far I got all Custom Post Types to show up in the regular Archives with this code
add_filter( 'getarchives_where' , 'ucc_getarchives_where_filter' , 10 , 2 );
function ucc_getarchives_where_filter( $where , $r ) {
$args = array( 'public' => true , '_builtin' => false );
$output = 'names'; $operator = 'and';
$post_types = get_post_types( $args , $output , $operator );
$post_types = array_merge( $post_types , array( 'post','referenzen' ) );
$post_types = "'" . implode( "' , '" , $post_types ) . "'";
return str_replace( "post_type = 'post'" , "post_type IN ( $post_types )" , $where );
}
function my_get_posts( $query ) {
if ( is_home() || is_category() || is_archive() && false == $query->query_vars['suppress_filters'] )
$query->set( 'post_type', array( 'post', 'referenzen', 'produkte' ) );
return $query;
}
add_filter( 'pre_get_posts', 'my_get_posts' );
But there must be a “hack” free solution to this as I can set each Custom Post Types “has_archive” parameter individually?
Any help is highly appreciated..
Regards, Marcel
]]>Can anybody show me how to set a limit on wp_get_archives to show archives by month BUT only those for the year 2010 and above – so the 2009 monthly archives are not shown on the sidebar archive widget.
Thank you!
]]><form action="<?php bloginfo('url'); ?>/" method="get">
<div>
<?php $select = wp_dropdown_categories('show_option_none=Categories&show_count=0&orderby=name&echo=0');
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);echo $select; ?>
<noscript><div><input type="submit" value="View" /></div></noscript>
</div></form>
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Date')); ?></option><?php wp_get_archives('type=monthly&format=option&show_post_count=0'); ?> </select>
<form action="<?php bloginfo('url'); ?>/" method="get"><div>
<?php $select = wp_dropdown_pages('show_option_none=Navigation&selected=Navigation&echo=0');
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
echo $select;
?>
<noscript><div><input type="submit" value="View" /></div></noscript></div></form>
What I want to do is to have a link within each dropdown that onclick will take you to either all-categories, all-pages or all-archives pages. So far it works in the Category dropdown (clicking the Category label returns posts from all categories). Is there a way I could make it work in the other dropdowns?
Thanks for your help!
]]>If i try to <?php wp_get_archives( $args ); ?> by month or year I get an error, (file not found), but if I try by post is working ?what must change in the args to get the archives by month.
permalinks are working ok.
]]>