Skip to main content

Home/ Wordpress/ Group items tagged post query

Rss Feed Group items tagged

Vernon Fowler

Post Types « WordPress Codex - 1 views

  • it is better if you prefix your identifier with a short namespace that identifies your plugin, theme or website that implements the custom post type. For example: acme_product or aw_product for products post type used by a hypothetical ACMEWidgets.com website
  • Namespacing your custom post type identifier will not guarantee against conflicts but will certainly minimize their likelihood.
  • Do pay close attention to not having your custom post type identifier exceed 20 characters though, as the post_type column in the database is currently a VARCHAR field of that length.
  • ...6 more annotations...
  • register_post_type( 'acme_product', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => __( 'Product' ) ), 'public' => true, 'has_archive' => true, ) );
  • When you namespace a custom post type identifier and still want to use a clean URL structure, you need to set the rewrite argument of the register_post_type() function. For example, assuming the ACME Widgets example from above:
  • 'rewrite' => array('slug' => 'products'),
  • Note: In some cases, the permalink structure must be updated in order for the new template files to be accessed when viewing posts of a custom post type.
  • single posts of a custom post type will use single-{post_type}.php and their archives will use archive-{post_type}.php where {post_type} is the $post_type argument of the register_post_type() function.
  • In any template file of the WordPress theme system, you can also create new queries to display posts from a specific post type. This is done via the post_type argument of the WP_Query object.
Vernon Fowler

WordPress › Support » Query post to show one post per author ? - 0 views

  • the simplest solution without using plugin and other custom loops. In case someone is interested, see the instruction here: http://www.dbuggr.com/smallwei/show-latest-post-author-wordpress-front-page/
Luciano Ferrer

How To Query Multiple Custom Post Types with query_posts [WordPress Tip] | Peter R Knight - 2 views

  •  
    " query_posts('post_type[]=post&post_type[]=page&post_type[]=event'); + http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts "
Vernon Fowler

Conditional Tags « WordPress Codex - 0 views

  • The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. For example, you might want to display a snippet of text above the series of posts, but only on the main page of your blog. With the is_home() Conditional Tag, that task is made easy.
  • is_single()  When any single Post (or attachment, or custom Post Type) page is being displayed. (False for Pages)
  •  
    Great for use with the Widget Logic plugin. A reference for all the conditional tags that help you restrict a widgets viewing.
  •  
    Warning: You can only use conditional query tags on or after the init action hook in WordPress. For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php, i.e. outside of a function.
jpollockgc

Custom Query Shortcode: Run a Loop inside Any Post/Page | Digging into WordPress - 0 views

  •  
    Custom loops via shortcode.
David McCart

Yoast GA Plugin for WP - Cross Site Scripting Vulnerability - 14 views

Yoast GA Plugin for WP - Cross Site Scripting Vulnerability Version Affected: 3.2.4 (newest) Info: The Google Analytics for WordPress plugin automatically tracks and segments all outbound links f...

XSS wordpress plugin

started by David McCart on 04 Dec 09 no follow-up yet
Tsudo liked it
1 - 7 of 7
Showing 20 items per page