Skip to main content

Home/ Wordpress/ Group items tagged reference WordPress

Rss Feed Group items tagged

Vernon Fowler

Function Reference/get template part « WordPress Codex - 2 views

  •  
    "Load a template part into a template (other than header, sidebar, footer). Makes it easy for a theme to reuse sections of code and an easy way for child themes to replace sections of their parent theme.

    Includes the named template part for a theme or if a name is specified then a specialized part will be included. If the theme contains no {slug}.php file then no template will be included.

    "
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

Function Reference/current user can « WordPress Codex - 2 views

  • Do not pass a role name to current_user_can(), as this is not guaranteed to work correctly (see #22624). Instead, you may wish to try the check user role function put together by AppThemes.
  •  
    "Function Reference/current user can
    Description
    Whether the current user has a certain capability."
Vernon Fowler

Function Reference/the date « WordPress Codex - 0 views

  • <?php the_date('Y-m-d'
    • Vernon Fowler
       
      The Y-m-d format is useful for HTML5 datetime attribute in a time element, i.e.  
      See http://html5doctor.com/the-time-element/ for further details 
Vernon Fowler

Function Reference/is plugin active « WordPress Codex - 0 views

  •  
    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
Vernon Fowler

Function Reference/wp title « WordPress Codex - 0 views

  • The wp_title() function should not be used by a theme in conjunction with other strings or functions (like concocting with bloginfo('name') ) to set the title because it will render plugins unable to rewrite page titles correctly. The best practice is to use the wp_title filter with a callback function. This method is now a requirement for themes.
Vernon Fowler

Function Reference/wp register sidebar widget « WordPress Codex - 0 views

  •  
    "wp_register_sidebar_widget( 'your_widget_1', // your unique widget id 'Your Widget', // widget name 'your_widget_display', // callback function array( // options 'description' => 'Description of what your widget does' ) );"
Albert Simó

How to Move WordPress Blog to New Domain or Location » My Digital Life - 0 views

  •  
    SQL Per a migrar els bloc d'un domini a un altre
Vernon Fowler

Embeds « WordPress Codex - 0 views

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.
Maggie Wolfe Riley

Digging Into WordPress - the book! - 4 views

  •  
    Two of my favorite web designers with super helpful blogs, Chris Coyier of CSS Tricks and Jeff Starr of Perishable Press, have just released their new collaboration! The book, "Digging Into WordPress," is now available as a PDF download, and if you buy the PDF book now, you will be eligible for a "sweet discount" on the hard copy of the book when it comes out, plus receive updates free.

    They've done a great job on this book, which covers setting up WordPress, anatomy of a WordPress theme, theme design and development, extending functionality including using WordPress as a CMS, working with RSS feeds, SEO, dealing with comments, and keeping your site "healthy." I already followed both of these designers before they began their collaboration, and have found countless useful tutorials, code snippets, design ideas, and much more on both of their sites - I've relied on Perishable Press as a source for great unobtrusive javascript code, and on CSS-Tricks for all kinds of other useful tools for making valid, functional, and beautiful sites.

    This book is bound to be a valuable reference to anyone who works with WordPress.
1 - 20 of 27 Next ›
Showing 20 items per page