mr orange
Forum Replies Created
-
What do you think of this code, from helgatheviking at stackexchange :
$terms = get_terms( 'genre' ); if( $terms ): foreach( $terms as $term ){ // The Query $args = array( 'post_type' => 'book', 'tax_query' => array( 'taxonomy' => 'genre', 'field' => 'term_id', 'terms' => $term->term_id ) ); $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { echo '<h2>' . ucwords( $term->name ) . '</h2>'; echo '<ul>'; while ( $the_query->have_posts() ) { $the_query->the_post(); echo '<li>' . get_the_title() . '</li>'; } echo '</ul>'; } } endif; /* Restore original Post Data */ wp_reset_postdata();
The only problem is that it lists all posts under each taxonomy instead of only the posts in that taxonomy
Perhaps I should simplify.
How do you list posts by category instead of solely by time? I would imagine you would need to have separate loops being called for each category. Thanks
Forum: Fixing WordPress
In reply to: Anchor Links to scroll loopThanks for your help! I am mostly interested on how to use the ScrollTo plugin to suit my needs. I have been working with it for the past couple hours and am having no luck. Do you have any advice?
Forum: Fixing WordPress
In reply to: Anchor Links to scroll loopI tried using that but couldn’t get it working. I didn’t mean to double post, I just simplified the question without the extraneous keyboard shortcut request.
—
Do you have any advice on how to implement this?Forum: Fixing WordPress
In reply to: Hard Code Plugin into theme?That’s what I thought, but it didn’t seem to work. It broke my theme. I was wondering if anyone knew of a tutorial or something for this.
Forum: Fixing WordPress
In reply to: Hard Code Plugin into theme?I only want that functionality built into the theme I am developing
Forum: Fixing WordPress
In reply to: Add Name For Each Dynamic SidebarNevermind I figured it out. If anyone else has this problem, just register 3 separate sidebars like this:
register_sidebar( array( 'name' => 'Blog', 'before_widget' => '<div id="%1$s" class="%2$s widget">', 'after_widget' => '</div></div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="widget_body">',)); register_sidebar(array( 'name' => 'Frontpage', 'before_widget' => '<div id="%1$s" class="%2$s widget">', 'after_widget' => '</div></div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="widget_body">', )); register_sidebar(array( 'name' => 'Portfolio', 'before_widget' => '<div id="%1$s" class="%2$s widget">', 'after_widget' => '</div></div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="widget_body">', ));
Forum: Fixing WordPress
In reply to: Add a 'Next Category' Page LinkAnyway to use this with a “Tag” page as well? Do you know how that might be implemented?
Forum: Fixing WordPress
In reply to: Show number of posts per yearThank you, but could you be more specific? I am not sure how to implement that to male it work.
Forum: Fixing WordPress
In reply to: Add a 'Next Category' Page LinkWorked like a charm Thanks!!
Forum: Fixing WordPress
In reply to: Anchor tags to link to each postI’m not exactly sure how that would give me what I am looking for.
Forum: Fixing WordPress
In reply to: Comment form automatically adds websiteYou rock. That did the trick.
Forum: Plugins
In reply to: Grid / List View on PostCould you repost the code thierry.eamon?
Forum: Fixing WordPress
In reply to: Create A Links Widget Dropdown (like Category & Archive Widget)Here is a screen capture of the widget I am referring to:
Forum: Fixing WordPress
In reply to: Create A Links Widget Dropdown (like Category & Archive Widget)Does anyone have any information about styling the Category drop down widget?