lundi 24 février 2014

wordpress


A hook, named wp_head, that runs just before the </head> tag is present in most themes, so we can just set our function to run wheneverwp_head runs, like so:
add_action("wp_head", "awepop_add_view")


 <?php add_filter$tag$function_to_add$priority$accepted_args ); ?> 

Example

The filter img_caption_shortcode is applied in media.php using the following call:
// Allow plugins/themes to override the default caption template.
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
if ( $output != '' )
 return $output;
The target filter function will be called with three arguments:
  • '' <= This is normally the value the filter will be modifying
  • $attr
  • $content
/////////////////////
  • archive-{post_type}.php
  • single-{post_type}.php
archive-{post_type}.php 
If your custom post type were 'product', and/or query_var = "product", WordPress would look for archive-product.php to display the archive of posts.
single-{post_type}.php 
If your custom post type were 'product', and/or query_var = "product", WordPress would look for single-product.php to display the single or permalink of the post.
If these files are not available in your Theme's directory WordPress will look for archive.php and single.php, respectively. If even these files are not present it will default to index.php.
/////////////////

   comments_template( '', true ); //pour afficher les commentaires et le plugin de facebook comment
 
into single-post

vendredi 21 février 2014

redirection wordpress


dans controller.php
function template_include( $path ) {
if ( !current_user_can( 'edit_listings' ) ){
//return locate_template( 'create-listing-no-auth.php' );
 wp_redirect( '/wp-login-toadd-annonce.php' );
exit();

}

page/2 uo paged=2

problème dfe permalik et des pages précdents et suivantes:

l'url des pages se transforme en page/2 or en utilisant permalink /nom... ca ne march e pas donc
j'ai du changer dans general-template.php

pour forcer les numéro de pages

i.com/?paged='. $next_page_badr . '">' . $next_text . '</a>';

jeudi 20 février 2014

.net data base connexion mysql

there is 2 ways with Vs to connect to a database
1-use odbc
2-.net provider
http://stackoverflow.com/questions/4235291/how-to-connect-to-a-mysql-data-source-in-visual-studio

dimanche 16 février 2014

wordpress custom redirection

function va_redirect_to_front_page() {
    if (isset($_GET['redirect_to'])) {
if($_GET['redirect_to']=="crer-annonce-2")
         wp_redirect( 'crer-annonce-2' );
else
wp_redirect( $_GET['redirect_to'] );
        exit();
    }
else
wp_redirect( 'dashboard' );
exit();
}

creat this funciton in theme/includes/core
don't forget to add action

change max pic uploaded or featured (vantage)

dans /vantage/function.php
chnage this values
define( 'VA_MAX_FEATURED', 5 );
define( 'VA_MAX_IMAGES', 5 );

Get Related Posts For Custom Post Type By Category

how to get related post with custom ones :

http://isabelcastillo.com/get-related-posts-custom-taxonomy-category

mercredi 5 février 2014

Comment activé MobileZone et MMS pour cartes SIM Maroc Telecom

un message SMS au numéro 505 contient: CONFIG
Vous recevrez des lettres à votre téléphone mobile
Un message vous demandera d'entrer votre code PIN
Entrez 0000 et ensuite enregistrer les paramètres par défaut
Ensuite, éteignez votre téléphone mobile et redémarrer

Nombre total de pages vues