Skip to main content

Home/ Wordpress/ Group items tagged wordpress codex

Rss Feed Group items tagged

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."
Luciano Ferrer

Template Hierarchy « WordPress Codex - 10 views

  •  
    "WordPress Templates fit together like the pieces of a puzzle to generate the web pages on your WordPress site. Some templates (the header and footer template files for example) are used on all the web pages, while others are used only under specific conditions. "
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

Embeds « WordPress Codex - 0 views

  • Twitter (WordPress 3.4+)
  • Make sure that the URL is on its own line and not hyperlinked
  • SoundCloud (WordPress 3.5+)
  • ...5 more annotations...
  • SlideShare (WordPress 3.5+)
  • Scribd
  • Flickr (both videos and images)
  • Vimeo (note older versions of WP have issues with https embeds, just remove the s from the https to fix)
  • YouTube (only public and "unlisted" videos and playlists - "private" videos will not embed)
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

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

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

Function Reference/bloginfo « WordPress Codex - 0 views

  • 'siteurl' - Deprecated since version 2.2. Echo home_url(), or use bloginfo('url'). 'home' - Deprecated since version 2.2. Echo home_url(), or use bloginfo('url').
  • home = http://www.example.com/home (DEPRECATED! use url option instead)
  • Please note that directory URLs are missing trailing slashes.
  • ...1 more annotation...
  • siteurl = http://www.example.com/home (DEPRECATED! use url option instead)
  •  
    Displays information about your site, mostly gathered from the information you supply in your User Profile and General Settings WordPress Administration Screens. It can be used anywhere within a template file. This always prints a result to the browser. If you need the values for use in PHP, use get_bloginfo().
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.
Luciano Ferrer

Template Tags/register nav menu « WordPress Codex - 5 views

  •  
    "Registers a menu location to use with navigation menus. Even if you explicitly set theme support for navigation menus, this function must be in your theme's functions file for WordPress to recognize navigation menu support in your theme. "
Luciano Ferrer

widgets - Give Editor Access To Sidebar - WordPress Development Stack Exchange - 3 views

  •  
    "The edit_theme_options capability should allow the user to edit the sidebar as described on this page : http://codex.wordpress.org/Appearance_Widgets_SubPanel Code to add to functions.php $role = get_role('editor'); $role->add_cap('edit_theme_options'); Edit: This should work to prevent editor accessing themes or menus function custom_admin_menu() { $user = new WP_User(get_current_user_id()); if (!empty( $user->roles) && is_array($user->roles)) { foreach ($user->roles as $role) $role = $role; } if($role == "editor") { remove_submenu_page( 'themes.php', 'themes.php' ); remove_submenu_page( 'themes.php', 'nav-menus.php' ); } } add_action('admin_menu', 'custom_admin_menu'); I haven't had chance to test this, but it only removes them from the menu they may still be able to access them by typing in the URL directly."
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

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/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. "
1 - 20 of 50 Next › Last »
Showing 20 items per page