Skip to main content

Home/ Wordpress/ Group items tagged codex

Rss Feed Group items tagged

anonymous

Pages (Creating your own pages) - 0 views

  • The files defining each Page Template are found in your Themes directory.
  •  
    Information (from the Codex) about creating your own page templates.
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

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/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

Roles and Capabilities « WordPress Codex - 2 views

  • Editor – somebody who can publish and manage posts including the posts of other users. Author – somebody who can publish and manage their own posts. Contributor – somebody who can write and manage their own posts but cannot publish them. Subscriber – somebody who can only manage their profile.
  •  
    "edit_published_posts"
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.
Luciano Ferrer

Category Templates « WordPress Codex - 3 views

  •  
    "This article explains how to change what happens when the blog viewer is visiting one of your site's Category pages. This involves the use of Themes and Template files, so if you are new to template files, you might want to read Using Themes and Stepping Into Templates first. "
Vernon Fowler

Using Permalinks « WordPress Codex - 0 views

  • Using %category% with multiple categories on a post When you assign multiple categories to a post, only one can show up in the permalink. This will be the lowest numbered category (see Manage Categories). The post will still be accessible through all the categories as normal.
Vernon Fowler

Must Use Plugins « WordPress Codex - 0 views

  • Always-on, no need to enable via admin and users cannot disable by accident.
  • Plugins in the must-use directory will not appear in the update notifications nor show their update status on the plugins page
  • Activation hooks are not executed
  • ...2 more annotations...
  • and as such all plugins should be carefully tested specifically in the mu-plugins directory before being deployed to a live site.
  • WordPress only looks for PHP files right inside the mu-plugins directory, and (unlike for normal plugins) not for files in subdirectories. You may want to create a proxy PHP loader file
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. my time is whatever here  See http://html5doctor.com/the-time-element/ for further details 
Vernon Fowler

Child Themes « WordPress Codex - 0 views

  • A child theme resides in its own directory in wp-content/themes. The scheme below shows the location of a child theme along with its parent theme (Twenty Twelve) in a typical WordPress directory structure:
  • This directory can contain as little as a style.css file, and as much as any full-fledged WordPress theme contains: style.css (required) functions.php (optional) Template files (optional) Other files (optional)
  • @import url("../twentytwelve/style.css");
  • ...4 more annotations...
  • Note on the @import rule There must be no other CSS rules above the @import rule. If you put other rules above it, it will be invalidated and the stylesheet of the parent will not be imported.
  • Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)
  • But, when creating child themes, be aware that using add_theme_support('post-formats') will override the formats as defined by the parent theme, not add to it.
  • A child theme can override any parental template by simply using a file with the same name.
Luciano Ferrer

WordPress › Dashboard Tweaks « WordPress Plugins - 4 views

  •  
    "A list of the tweaks included in the Dashboard Tweaks plugin: - change the WordPress logo in the top-left of the admin bar with a custom admin logo - link that logo to the home URL instead of the new wp-admin/about.php - remove the entire sub-menu with links to Codex, forums and what not - remove the Visit Site sub-menu under the site's name - change "Howdy" into "Welcome back" - add a special favicon for the Dashboard only (ideally different from the frontend, but up to you) - change the tab title into a standard "Dashboard of [sitename]" - remove icons in front of Dashboard menus - reduce page heading size - remove publish icon of Add new Post/Page screens - add colored background to sidebar active sub-menu to add contrast - add colored background to activated plugins to add contrast - add custom footer text"
Vernon Fowler

Function Reference/get bloginfo « WordPress Codex - 0 views

  • Consider using get_template_directory_uri() instead (for the parent template directory) or get_stylesheet_directory_uri() (for the child template directory).
    • Vernon Fowler
       
      Using TwentyEleven as parent theme will make use of this for HTML5.js in header.php
1 - 20 of 50 Next › Last »
Showing 20 items per page