MichaelH
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Naming PagesThere isn’t a way to ‘associate’ posts to Pages. You could consider using categories on your posts, then create a Page and use a plugin such as http://wordpress.org/extend/plugins/list-category-posts/ to list posts in a particular category on a particular page.
Forum: Fixing WordPress
In reply to: How to query posts by their meta dataYou’d have to resort to wpdb or retrieve all 2010 posts, then filter for January.
Forum: Fixing WordPress
In reply to: Get categoriesYou’d have to add JOINs for the taxonomy table(s) then do a ORDERBY one of those fields.
Forum: Themes and Templates
In reply to: Can twenty ten have several pages under a menu?From Administration > Appearance > Menus
You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy.
Forum: Fixing WordPress
In reply to: How to query posts by their meta data<?php $args=array( 'meta_key'=>'month', 'meta_value'=> 'January', 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo 'List of Posts'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Forum: Hacks
In reply to: Hooks vs shortcodes?I would guess shortcodes/plugins are slower that hooks.
As far as maintenance, from an user standpoint shortcodes/widgets would be preferred.
Forum: Fixing WordPress
In reply to: Calculate occurrences of text word in postmeta meta_valueYeah, but I believe you will need to play with something like unserialize to do that…
Forum: Plugins
In reply to: Taxonomy PaginationOkay, just trying to make sure paging works in your environment for those conditions.
Maybe someone else will have some other solutions.
Forum: Fixing WordPress
In reply to: Get specific posts as linksIt might be possible but not sure I know how to do that.
You will want to look at Custom Fields and maybe something will become clearer.
Forum: Fixing WordPress
In reply to: Calculate occurrences of text word in postmeta meta_value<?php $count = 0; $results = $wpdb->get_results("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = '_custom_meta' and meta_value LIKE '%super_m%';"); foreach($results as $result) { $count = $count + substr_count($result->meta_value, 'super_m'); } echo '<p>count is ' . $count . '</p>'; ?>Forum: Everything else WordPress
In reply to: WordPress logo in t-shirt.Forum: Themes and Templates
In reply to: Showing a link form a custom field, with an imageNot sure exactly what you are asking but here’s one example
If custom field is present, formulate and display link from meta value
<?php $link = get_post_meta($post->ID, 'link_url', true); $text = get_post_meta($post->ID, 'link_text', true); if ($link){ echo 'Credit: <a href="'.$link .'">'.$text.'</a>'; } ?>oops see alchymyth got there
Forum: Plugins
In reply to: Anyone know a good "Subscribe via email" widget I could add?Might look at http://wordpress.org/extend/plugins/subscribe2/
Forum: Hacks
In reply to: Hooks vs shortcodes?Hooks are meant for programmers to be able to execute their code in specific situation.
Shortcodes are meant to provide the user an easy way to ‘invoke’ the functionality of a plugin (e.g. putting the shortcode in a post’s content and having it display a list of posts in a specific category).
Forum: Fixing WordPress
In reply to: Get specific posts as linksNot sure what you are trying to do with the target so please provide an example of an
a hreflink with what you want.But here’s something you can play with:
<?php $cat_id = get_cat_ID('uncategorized'); //<--your category here $args=array( 'cat' => $cat_id, 'meta_key'=>'your custom field here', 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo 'List of Posts'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>"rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>