lundi 28 avril 2014

creer un custom category type et utiliser wp_dropdown_categories menu pour lister les valeur

1- dans function.php

définiser la nouvelle taxonomy :



add_action( 'init', 'addresse_init' );

function addresse_init() {
// create a new taxonomy

$labels = array(

'name' => __( 'adr Categories', APP_TD ),

'singular_name' => __( 'Annonce Category', APP_TD ),

'search_items' => __( 'Search Annonce Categories', APP_TD ),

'all_items' => __( 'All Categories', APP_TD ),

'parent_item' => __( 'Parent Annonce Category', APP_TD ),

'parent_item_colon' => __( 'Parent Annonce Category:', APP_TD ),

'edit_item' => __( 'Edit Annonce Category', APP_TD ),

'update_item' => __( 'Update Annonce Category', APP_TD ),

'add_new_item' => __( 'Add New Annonce Category', APP_TD ),

'new_item_name' => __( 'New Annonce Category Name', APP_TD ),

'add_or_remove_items' => __( 'Add or remove Annonce categories', APP_TD ),

'menu_name' => __( 'adr', APP_TD ),

);



$args = array(

'labels' => $labels,

'public' => true,

'show_in_nav_menus' => true,

'show_ui' => true,

'show_tagcloud' => false,

'hierarchical' => true,



'query_var' => true,

'rewrite' => array( 'slug' => 'listings/category', 'with_front' => false ),

);



register_taxonomy( VA_LISTING_ADDRESSE, VA_LISTING_PTYPE, $args );
}


2-dans la page que vous voulez appeler le dropdwon :

<div class="form-field">
<?php wp_dropdown_categories( array(
    'walker'=> new SH_Walker_TaxonomyDropdown(),
'taxonomy' => VA_LISTING_ADDRESSE,
'hide_empty' => false,
'hierarchical' => true,
'name' => VA_LISTING_ADDRESSE,
/* 'selected' => $listing->category,*/
'show_option_none' => __( 'Selectionner une Cat&eacute;gorie', APP_TD ),
'class' => 'required',
'orderby' => 'id',
'value'=>'slug'

//'id' => 'ba3333'.$taxonomy

  ) ); ?>
 </div>

lundi 21 avril 2014

category group list get slug instead id

pour avoir un slug dans un url au lieu de id qui ne donne pas de resultat
have to resolve


http://stackoverflow.com/questions/14078572/how-to-change-value-for-options-and-select-in-wp-dropdown-categories

vendredi 11 avril 2014

facebook pagination wordpress problem

http://www.shayatik.com/2014/03/facebook-plugin-breaks-wordpress-pagination/#comment-41

best sol is :

When does pagination issue by Facebook WordPress plugin appears?

  • Only on homepage
  • If you are using “Post name” option in Permalink Settings
  • If you are using “Static” homepage option in your Reading Settings which means you are using some custom page template to display your posts in a default loop
The problem with this issue is that WordPress actually generates proper pagination link, (i.e. yourwebsite.com/page/2), but it is somehow always redirected to your home page.

Solution

This handy snippet should do a trick. Make sure it is included somewhere in thefunctions.php file of your theme.
/* Fix pagination issue caused by Facebook plugin */

function meks_fb_plugin_pagination_fix() {

  //Check if plugin is activated and if we are on the homepage
  if(class_exists('Facebook_Loader') && is_front_page()){
    global $wp_query;
    $page = get_query_var('page');
    $paged = get_query_var('paged');

    //Check if we are trying to reach pagination link
    if($page > 1 || $paged > 1){
      unset($wp_query->queried_object);
     }

  }

}

add_action( 'wp', 'meks_fb_plugin_pagination_fix', 99 );

wordpress popup


modification pour changer le popup de wordpress

install

Shutter Reloaded Plus plugin

and pour desactiver le popup de vtge j'ai desactivi le script jquery.colorbox-min.jsx



D:\public_html\wp-content\themes\vantage\includes\controllers.php
wp_enqueue_script(
'colorbox',
get_template_directory_uri() . '/scripts/jquery.colorbox-min.js',
array( 'jquery' ),
'1.3.19'
);

jeudi 10 avril 2014

surcharger l'affichage de wordpress add_action

le code original
<?php
/**
* Fires following the 'Password' field in the login form.
*
* @since 2.1.0
*/
do_action( 'login_form' );
?>

pour le charger dans le plugin on utilise

add_action('login_form', 'fction');

et on defini le code à ajouter dans la fct fction

exp pour ajouter un affichage à l'affichage original 

mardi 8 avril 2014

Nombre total de pages vues