Tag Info

Hot answers tagged

9

You have to run through each blog and fetch the recent attachments with: $args = array ( 'post_type' => 'attachment', 'numberposts' => 30 ); $attachments = get_posts( $args ); Dashboard widgets are registered on wp_network_dashboard_setup in multi-site and wp_dashboard_setup in single-site. Make sure to add the following line to the ...


6

What is a good start point to study? Read a few tutorials on Custom Post Types and Custom Taxonomies. Here´s a good one to get started. What plugins do I need to install? It wouldn´t be too difficult to create the site structure without any plugins. Do I need to install wp-ecommerce plugin? Based on the information provided I don´t think you need that.


4

If your looking for an e-commerce plugin that allows you to remove the "e-commerce" part of it, WooCommerce along with Catalog Visibility Options is a good choice. Here's a description of what that add-on plugin does: Transform WooCommerce into an online catalog by removing eCommerce functionality Wait, what? Remove eCommerce functionality? It may ...


2

Is WordPress a right choice for my requirements? Is it only for blogging or can be used for any kind of site? (corporate, portfolio, catalog, personal info etc.) WordPress can absolutely be used for any kind of site. But note that while things like post and pages are ready out of the box and simple to use, it takes some additional development if ...


2

Hi @craftsman: I'll echo everything that @Rarst said and I'll add links to two of my answers that might help you: Tips for using WordPress as a CMS? Implementing a CrunchBase.com Clone using WordPress? If you don't want to do it yourself I'll recommend a theme I just purchased for a similar project from WooTheme's called Listings. WooTheme's Listings ...


2

easy just pass it the $id off which to get the children global $id; wp_list_pages("title_li=&child_of=$id"); of if you want in the loop then wp_list_pages("title_li=&child_of=$post->ID");


2

You came to this in a bad time of changes. Tables in admin are being migrated from the old and scary ways to new shiny List Tables API using subclasses of WP_List_Table. Problem is - while classes are already in and being using core code, they are currently not meant for being used otherwise. Proper API for theme/plugin usage is planned, but I think it ...


2

this should work for you: if ( is_user_logged_in() ): global $current_user; get_currentuserinfo(); $author_query = array('posts_per_page' => '-1','author' => $current_user->ID); $author_posts = new WP_Query($author_query); while($author_posts->have_posts()) : $author_posts->the_post(); ?> <a ...


2

You can use the post__not_in parameter of WP_Query to exclude an array of post IDs from the query. get_the_category() returns an array of term objects, so the get_term_by is redundant. Also is_single() will always be true in content-single.php (not strictly speaking true but only not so if you are interferring with the template selection). (Finally, in ...


1

This trick should help you... <?php add_action('pre_get_posts', 'filter_posts_list'); function filter_posts_list($query) { //$pagenow holds the name of the current page being viewed global $pagenow; $post_type = $query->get('post_type'); //Check the post type and whether its the list page, then set the taxonomy if($post_type == ...


1

try pasting this in your theme's functions.php file add_filter( 'parse_query', 'display_autosave_and_revisions' ); function display_autosave_and_revisions( $query ) { global $pagenow,$typenow; if ( is_admin() && $pagenow == 'edit.php' && $typenow == "post") { $query->query_vars['post_type'] = array('revision','post'); ...


1

It would all depend on your skill level and the time you have available ... and how much time you have to read other plugins / themes / and the WordPress source code. Are you being paid for the project? Is it for yourself? It would be helpful if you could elaborate a bit ... but until then I'll suggest a workable, cheap, quick solution that may be ...


1

You've already got code to figure out which category you want to show posts from, here is how you would grab all the posts in that category: // create a query to grab our posts in category of ID $postcat $q = new WP_Query(array( 'cat' => $postcat)); if($q->have_posts()){ // foreach post found while($q->have_posts()){ ...


1

there is another way easier than that all in archive.php replace that code <?php get_template_part('loop', $the_template_part);} ?> with this code <?php if (is_category('CAT_ID')) {get_template_part('loop2', $the_template_part); } else {get_template_part('loop', $the_template_part);} ?> and then ...


1

I'm trying to make a custom template for my category pages that only pulls in post under a specific category. You know that we have category templates built in to WordPress. http://codex.wordpress.org/Category_Templates You really can just make category-slug.php for the category and be done with it. Unless you're trying to say that you want the ...


1

This worked for me. $user_query = new WP_User_Query( array( 'search' => '*example.net*', 'search_columns' => array('user_url') )); $authors = $user_query->get_results(); The wild card to be used in the search string is '*' and not '%'. Also you have to include the 'search_columns' parameter with the following possible values search_columns = ...


1

Ideally, place this in a plugin (so it's not overwritten when you update the theme): function wpse_106185_elist_categories( $args ) { return $args + array( 'depth' => 1, ); } add_filter( 'listing_categories_args', 'wpse_106185_elist_categories' ); Alternatively, a quick fix is to edit this line... $elist_categories_args = array( ...


1

Use a custom field named 'order' in each post. Remove the field from posts you do not want to display. Then call the WP_Query object to sort the order field numerically (meta_value_num) skipping any values less or equal to 0 (like in the meta_query below). $posts = new WP_Query( array( 'orderby' => 'meta_value_num', 'meta_key' => 'order', ...


1

WordPress 3.7 introduced wp_get_sites() which will return an array of sites in a WordPress Multisite network. This can replace get_blog_ids().


1

Paste this at the end of your child themes functions.php file function fb_filter_child_cats($query) { $cat = get_term_by('name', $query->query_vars['category_name'], 'category'); $child_cats = (array) get_term_children( &$cat->term_id, 'category' ); // also possible // $child_cats = (array) get_term_children( ...



Only top voted, non community-wiki answers of a minimum length are eligible