Skip to main content

Home/ Wordpress/ Group items tagged function

Rss Feed Group items tagged

Luciano Ferrer

Convertir fechas de PHP a castellano - 0 views

  •  
    "function fechaCastellano ($fecha) { $fecha = substr($fecha, 0, 10); $numeroDia = date('d', strtotime($fecha)); $dia = date('l', strtotime($fecha)); $mes = date('F', strtotime($fecha)); $anio = date('Y', strtotime($fecha)); $dias_ES = array("Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"); $dias_EN = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); $nombredia = str_replace($dias_EN, $dias_ES, $dia); $meses_ES = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); $meses_EN = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $nombreMes = str_replace($meses_EN, $meses_ES, $mes); return $nombredia." ".$numeroDia." de ".$nombreMes." de ".$anio; }"
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. my time is whatever here  See http://html5doctor.com/the-time-element/ for further details 
Luciano Ferrer

Function Reference/is home « WordPress Codex - 3 views

  •  
    "Function Reference/is home This Conditional Tag checks if the main page is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE. "
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

WordPress › Support » Deprecated function: is_site_admin() - 0 views

  • is_site_admin() (p2/inc/p2.php:29) is deprecated in favor of is_super_admin()
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' ) );"
1 - 13 of 13
Showing 20 items per page