Comment enlever le « Posted on », la date, le nom de l’auteur et le nom (Créer un compte)

  • Statut : non résolu
15 sujets de 1 à 15 (sur un total de 27)
  • Auteur
    Messages
  • #565511
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Bonjour,

    Ma configuration WP actuelle
    – Version de WordPress :
    – Version de PHP/MySQL :
    – Thème utilisé :
    – Extensions en place :
    – Nom de l’hebergeur :
    – Adresse du site :

    Problème(s) rencontré(s) :

    Je reviens vers vous pour une nouvelle question :

    Comment enlever le « Posted on », la date, le nom de l’auteur et le nom de la catégorie. Mais aussi comment réduire la hauteur des images dans le homepage (uniquement la hauteur)
    Mon site: http://www.footempo.com
    Thème utilisé: Kings Club

    Je me suis inspiré du modèle de site: http://www.dailymercato.com pour la dimension des images

    #1064660
    Qwindoo
    Modérateur
    Maître WordPress
    2861 contributions

    Hello,

    Tu peux chercher la ligne « Posted on » dans le dossier de ton thème, cela te donnera le ou les fichier(s) correspondant(s). N’hésite pas à poster le code du fichier en question ici entre balises b]code[/b / [/code] en cas de besoin 😉

    #1064661
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    J’ai chercher dans le feuille de style, mais il n’ya pas posted on malheureusement

    #1064662
    Qwindoo
    Modérateur
    Maître WordPress
    2861 contributions

    Ah non, ce ne sera pas dans la feuille de style mais bien dans l’un des fichiers php de ton thème. Malheureusement je ne connais pas ce Kings Club, donc je ne peux pas être beaucoup plus précis… est-ce un thème gratuit ? Si oui, peux-tu nous donner un lien pour le télécharger ?

    #1064663
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Non je l’ai acheté. la seule chose que j’ai trouvée et qui ressemble à ce que vous dites, c’est post-meta.php et voici le contenu:

    ID, « post », true);
    global $px_xmlObject;
    if ( $post_xml «  » ) {
    $px_xmlObject = new SimpleXMLElement($post_xml);
    $var_pb_post_author = $px_xmlObject->var_pb_post_author;
    $var_pb_post_social_sharing = $px_xmlObject->var_pb_post_social_sharing;
    $var_pb_post_attachment = $px_xmlObject->var_pb_post_attachment;
    $var_pb_post_attachment_title = $px_xmlObject->var_pb_post_attachment_title;
    $var_pb_post_featured = $px_xmlObject->var_pb_post_featured;
    } else {

    $var_pb_post_social_sharing =  »;
    $var_pb_post_author = ‘on’;


    $var_pb_post_attachment = ‘on’;
    $var_pb_post_attachment_title = ‘Attachment’;
    $var_pb_post_featured =  »;

    }
    ?>
    <script type="text/javascript" src="/scripts/admin/select.js »>
    <link rel="stylesheet" href="/css/admin/bootstrap.min.css »>
    <script type="text/javascript" src="/scripts/admin/bootstrap-3.0.js »>
    <div class="page-wrap event-meta-section">
    <div class="option-sec row">
    <div class="opt-conts">


    <ul class="form-elements on-off-options">
    <li class="to-label"><label></label></li>
    <li class="to-field">
    <label class="cs-on-off">
    <input type="checkbox" name="var_pb_post_featured" value="on" class="myClass" />
    <span></span>
    </label>
    </li>
    <li class="to-label"><label></label></li>
    <li class="to-field">
    <label class="cs-on-off">
    <input type="checkbox" name="var_pb_post_social_sharing" value="on" class="myClass" />
    <span></span>
    </label>
    </li>

    <li class="to-label"><label></label></li>
    <li class="to-field">
    <label class="cs-on-off">
    <input type="checkbox" name="var_pb_post_author" value="on" class="myClass" />
    <span></span>
    </label>
    </li>
    </ul>
    <ul class="form-elements">
    <li class="to-label"><label></label></li>
    <li class="to-field">
    <label class="cs-on-off">
    <input type="checkbox" name="var_pb_post_attachment" value="on" class="myClass" />
    <span></span>
    </label>
    </li>
    <li class="to-label"><label></label></li>
    <li class="to-field">

    <input type="text" name="var_pb_post_attachment_title" value=" » />

    </li>
    </ul>

    </div>

    </div>

    <div class="clear"></div>


    </div>
    <?php
    }

    if ( isset($_POST['post_meta_form']) and $_POST['post_meta_form'] == 1 ) {
    add_action( 'save_post', 'px_meta_post_save' );
    function px_meta_post_save( $post_id ) {
    if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
    if (empty($_POST["var_pb_post_author"])){ $_POST["var_pb_post_author"] = "";}
    if (empty($_POST["var_pb_post_social_sharing"])){ $_POST["var_pb_post_social_sharing"] = "";}
    if (empty($_POST["var_pb_post_attachment_title"])){ $_POST["var_pb_post_attachment_title"] = "";}
    if (empty($_POST["var_pb_post_attachment"])){ $_POST["var_pb_post_attachment"] = "";}
    if (empty($_POST["var_pb_post_featured"])){ $_POST["var_pb_post_featured"] = "";}

    $sxe = new SimpleXMLElement(" »);

    $sxe->addChild(‘var_pb_post_attachment_title’, $_POST[‘var_pb_post_attachment_title’] );
    $sxe->addChild(‘var_pb_post_attachment’, $_POST[‘var_pb_post_attachment’] );
    $sxe->addChild(‘var_pb_post_featured’, $_POST[‘var_pb_post_featured’] );
    $sxe->addChild(‘var_pb_post_author’, $_POST[‘var_pb_post_author’] );
    $sxe->addChild(‘var_pb_post_social_sharing’, $_POST[‘var_pb_post_social_sharing’] );
    $sxe = save_layout_xml($sxe);
    $counter = 0;



    update_post_meta( $post_id, ‘post’, $sxe->asXML() );

    }
    }

    //add extra fields to team category edit form hook
    add_action ( ‘category_edit_form_fields’, ‘px_extra_category_fields’);
    add_action ( ‘category_add_form_fields’, ‘px_extra_category_fields’);
    // Add Category Fields
    function px_extra_category_fields( $tag ) { //check for existing featured ID
    if ( isset($tag->term_id) ) {$t_id = $tag->term_id; }
    else { $t_id = «  »; }
    $cat_meta = get_option( « cat_$t_id »);
    ?>
    <tr class="form-field">
    <th scope="row" valign="top"><label for="cat_Icon_url"></label></th>
    <td>
    <ul class="form-elements on-off-options">

    <li class="to-field">
    <label class="cs-on-off">
    <input type="checkbox" name="cat_meta[menu]" value="on" class="myClass" />
    <span></span>
    </label>

    </li>
    </ul>

    </td>
    </tr>
    <tr class="form-field">
    <th scope="row" valign="top"><label for="cat_Icon_url"></label></th>
    <td>

    <option value="2 Level Links" >
    <option value="Category Post" >

    </td>
    </tr>

    Qwindoo : modifié pour mettre le code entre balises

    #1064664
    Qwindoo
    Modérateur
    Maître WordPress
    2861 contributions

    Hmm non, ce n’est pas dans ce fichier-là 😕

    #1064665
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Alors voici tout ce qui se trouve dans éditeur:

    Modèles
    Modèle pour l’erreur 404
    (404.php)
    Archives
    (archive.php)
    Modèle pour un auteur
    (author.php)
    Commentaires
    (comments.php)
    Pied de page du thème
    (footer.php)
    Fonctions du thème
    (functions.php)
    admin_functions.php
    (galleries/admin_functions.php)
    functions.php
    (galleries/functions.php)
    page_gallery.php
    (galleries/page_gallery.php)
    single-px_gallery.php
    (galleries/single-px_gallery.php)
    En-tête du thème
    (header.php)
    admin_functions.php
    (include/admin_functions.php)
    event.php
    (include/event.php)
    gallery.php
    (include/gallery.php)
    lang_upload.php
    (include/lang_upload.php)
    page_builder.php
    (include/page_builder.php)
    player.php
    (include/player.php)
    pointtable.php
    (include/pointtable.php)
    post_meta.php
    (include/post_meta.php)
    review_save.php
    (include/review_save.php)
    team_term_box.php
    (include/team_term_box.php)
    tgm_plugin_activation.php
    (include/tgm_plugin_activation.php)
    theme_activation.php
    (include/theme_activation.php)
    theme_colors.php
    (include/theme_colors.php)
    theme_option.php
    (include/theme_option.php)
    widgets.php
    (include/widgets.php)
    Modèle pour la page d’accueil
    (index.php)
    Page individuelle
    (page.php)
    page_blog.php
    page_contact.php
    page_contact_submit.php
    page_event.php
    page_gallery.php
    page_gallery_albums.php
    page_pointtable.php
    page_slider.php
    page_team.php
    Résultats de recherche
    (search.php)
    Formulaire de recherche
    (searchform.php)
    single-events.php
    single-player.php
    single-px_gallery.php
    Article seul
    (single.php)
    woocommerce.php
    Styles
    Feuille de style
    (style.css)

    #1064666
    Qwindoo
    Modérateur
    Maître WordPress
    2861 contributions

    Regarde dans index.php, single.php et functions.php ?

    #1064667
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    bon, on voit dans index d’abord ?

    <?php
    // Header File
    get_header();
    global $px_theme_option;
    $px_layout =  »;
    if(isset($px_theme_option)){ $px_layout = $px_theme_option; }elseif(!isset($px_theme_option)){ $px_layout = ‘right’;}

    if ( $px_layout  » and $px_layout « none » and $px_layout == ‘left’) : ?>

    <div class=" »>

    <?php
    if (empty($_GET))
    $_GET = 1;
    if (!isset($_GET[« s »])) {
    $_GET[« s »] =  »;
    }
    if ( have_posts() ) :
    while ( have_posts() ) : the_post();
    px_defautlt_artilce();
    endwhile;
    $qrystr =  »;
    // pagination start
    if ( $px_theme_option == « Show Pagination » and $wp_query->found_posts > get_option(‘posts_per_page’)) {
    echo « 

    « ;
    }
    // pagination end
    endif; ?>

    <?php
    if ( $px_layout  » and $px_layout « none » and $px_layout == ‘right’) : ?>

    <?php
    //Footer FIle
    get_footer();
    ?>

    #1064668
    Qwindoo
    Modérateur
    Maître WordPress
    2861 contributions

    functions.php maintenant ? Il faut trouver où est définie la fonction « px_defautlt_artilce » qui paraît horriblement mal écrite 😗

    #1064669
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Ouf ! je l’ai repéré dans functions.php
    Je te l’envoie en 4 parties car c’est énorme:

    Partie 1:

    <?php
    /* add action filter and theme support on theme setup */
    add_action( ‘after_setup_theme’, ‘px_theme_setup’ );
    function px_theme_setup() {
    /* Add theme-supported features. */ // This theme styles the visual editor with editor-style.css to match the theme style.
    add_editor_style();
    // Make theme available for translation
    // Translations can be filed in the /languages/ directory
    load_theme_textdomain(‘Kingsclub’, get_template_directory() . ‘/languages’);

    if (!isset($content_width)){
    $content_width = 1160;
    }

    $args = array(‘default-color’ =>  »,’default-image’ =>  »,);
    add_theme_support(‘custom-background’, $args);
    add_theme_support(‘custom-header’, $args);
    // This theme uses post thumbnails
    add_theme_support(‘post-thumbnails’);
    // Add default posts and comments RSS feed links to head
    add_theme_support(‘automatic-feed-links’);
    add_theme_support(« title-tag »);
    // Post Formats
    add_theme_support( ‘post-formats’, array(
    ‘aside’, ‘image’, ‘video’, ‘audio’, ‘quote’, ‘link’, ‘gallery’,
    ) );
    /* Add custom actions. */
    global $pagenow;

    if (is_admin() && isset($_GET) && $pagenow == ‘themes.php’){

    if(!get_option(‘px_theme_option’)){
    add_action(‘admin_head’, ‘px_activate_widget’);
    add_action(‘init’, ‘px_activation_data’);
    wp_redirect( admin_url( ‘admin.php?page=px_demo_importer’ ) );
    }
    }

    if (!session_id()){
    add_action(‘init’, ‘session_start’);
    }

    add_action(‘init’, ‘px_register_my_menus’ );
    add_action(‘admin_enqueue_scripts’, ‘px_admin_scripts_enqueue’);
    add_action(‘wp_enqueue_scripts’, ‘px_front_scripts_enqueue’);
    add_action(‘pre_get_posts’, ‘px_get_search_results’);

    add_action(‘widgets_init’, create_function( », ‘return register_widget(« facebook_module »);’) );
    add_action(‘widgets_init’, create_function( », ‘return register_widget(« px_gallery »);’));
    add_action(‘widgets_init’, create_function( », ‘return register_widget(« recentposts »);’) );
    add_action(‘widgets_init’, create_function( », ‘return register_widget(« px_fixture_countdown »);’) );
    add_action(‘widgets_init’, create_function( », ‘return register_widget(« px_twitter_widget »);’));
    add_action(‘widgets_init’, create_function( », ‘return register_widget(« px_pointstable »);’));
    add_action(‘widgets_init’, create_function( », ‘return register_widget(« px_MailChimp_Widget »);’) );
    /* Add custom filters. */
    add_filter(‘widget_text’, ‘do_shortcode’);
    add_filter(‘the_password_form’, ‘px_password_form’ );
    add_filter(‘add_to_cart_fragments’, ‘woocommerce_header_add_to_cart_fragment’);
    add_filter(‘wp_page_menu’,’px_add_menuid’);
    add_filter(‘wp_page_menu’, ‘px_remove_div’ );
    add_filter(‘nav_menu_css_class’, ‘px_add_parent_css’, 10, 2);
    add_filter(‘pre_get_posts’, ‘px_change_query_vars’);
    add_filter(‘user_contactmethods’,’px_contact_options’,10,1);
    $home = get_page_by_title( ‘Home’ );
    if($home  » && get_option( ‘page_on_front’ ) == « 0 »){
    update_option( ‘page_on_front’, $home->ID );
    update_option( ‘show_on_front’, ‘page’ );
    }
    }
    error_reporting(0);
    if ( ! function_exists( ‘px_register_required_plugins’ ) ) {
    // tgm class for (internal and WordPress repository) plugin activation start
    require_once dirname( __FILE__ ) . ‘/include/tgm_plugin_activation.php’;
    add_action( ‘tgmpa_register’, ‘px_register_required_plugins’ );
    function px_register_required_plugins() {
    /**
    * Array of plugin arrays. Required keys are name and slug.
    * If the source is NOT from the .org repo, then source is also required.
    */
    $plugins = array(
    // This is an example of how to include a plugin from the WordPress Plugin Repository

    array(
    ‘name’ => ‘Revolution Slider’,
    ‘slug’ => ‘revslider’,
    ‘source’ => get_template_directory_uri() . ‘/include/plugins/revslider.zip’,
    ‘required’ => false,
    ‘version’ =>  »,
    ‘force_activation’ => false,
    ‘force_deactivation’ => false,
    ‘external_url’ =>  »,
    ),
    array(
    ‘name’ => ‘Contact Form 7’,
    ‘slug’ => ‘contact-form-7’,
    ‘required’ => false,
    ),
    array(
    ‘name’ => ‘Woocommerce’,
    ‘slug’ => ‘woocommerce’,
    ‘required’ => false,
    ),

    );
    // Change this to your theme text domain, used for internationalising strings
    $theme_text_domain = ‘Kingsclub’;
    /**
    * Array of configuration settings. Amend each line as needed.
    * If you want the default strings to be available under your own theme domain,
    * leave the strings uncommented.
    * Some of the strings are added into a sprintf, so see the comments at the
    * end of each line for what each argument will be.
    */
    $config = array(
    ‘domain’ => ‘Kingsclub’, // Text domain – likely want to be the same as your theme.
    ‘default_path’ =>  », // Default absolute path to pre-packaged plugins
    ‘parent_menu_slug’ => ‘themes.php’, // Default parent menu slug
    ‘parent_url_slug’ => ‘themes.php’, // Default parent URL slug
    ‘menu’ => ‘install-required-plugins’, // Menu slug
    ‘has_notices’ => true, // Show admin notices or not
    ‘is_automatic’ => true, // Automatically activate plugins after installation or not
    ‘message’ =>  », // Message to output right before the plugins table
    ‘strings’ => array(
    ‘page_title’ => __( ‘Install Required Plugins’, ‘Kingsclub’ ),
    ‘menu_title’ => __( ‘Install Plugins’, ‘Kingsclub’ ),
    ‘installing’ => __( ‘Installing Plugin: %s’, ‘Kingsclub’ ), // %1$s = plugin name
    ‘oops’ => __( ‘Something went wrong with the plugin API.’, ‘Kingsclub’ ),
    ‘notice_can_install_required’ => _n_noop( ‘This theme requires the following plugin: %1$s.’, ‘This theme requires the following plugins: %1$s.’ ), // %1$s = plugin name(s)
    ‘notice_can_install_recommended’ => _n_noop( ‘This theme recommends the following plugin: %1$s.’, ‘This theme recommends the following plugins: %1$s.’ ), // %1$s = plugin name(s)
    ‘notice_cannot_install’ => _n_noop( ‘Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.’, ‘Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.’ ), // %1$s = plugin name(s)
    ‘notice_can_activate_required’ => _n_noop( ‘The following required plugin is currently inactive: %1$s.’, ‘The following required plugins are currently inactive: %1$s.’ ), // %1$s = plugin name(s)
    ‘notice_can_activate_recommended’ => _n_noop( ‘The following recommended plugin is currently inactive: %1$s.’, ‘The following recommended plugins are currently inactive: %1$s.’ ), // %1$s = plugin name(s)
    ‘notice_cannot_activate’ => _n_noop( ‘Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.’, ‘Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.’ ), // %1$s = plugin name(s)
    ‘notice_ask_to_update’ => _n_noop( ‘The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.’, ‘The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.’ ), // %1$s = plugin name(s)
    ‘notice_cannot_update’ => _n_noop( ‘Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.’, ‘Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.’ ), // %1$s = plugin name(s)
    ‘install_link’ => _n_noop( ‘Begin installing plugin’, ‘Begin installing plugins’ ),
    ‘activate_link’ => _n_noop( ‘Activate installed plugin’, ‘Activate installed plugins’ ),
    ‘return’ => __( ‘Return to Required Plugins Installer’, ‘Kingsclub’ ),
    ‘plugin_activated’ => __( ‘Plugin activated successfully.’, ‘Kingsclub’ ),
    ‘complete’ => __( ‘All plugins installed and activated successfully. %s’, ‘Kingsclub’ ), // %1$s = dashboard link
    ‘nag_type’ => ‘updated’ // Determines admin notice type – can only be ‘updated’ or ‘error’
    )
    );
    tgmpa( $plugins, $config );
    }
    // tgm class for (internal and WordPress repository) plugin activation end
    }

    /* adding custom images while uploading media start */

    // Banner, Blog Large
    add_image_size(‘px_media_1’, 768, 403, true);
    // Spot Light, Gallery
    add_image_size(‘px_media_2’, 470, 353, true);
    // Popular Players
    add_image_size(‘px_media_3’, 390, 390, true);
    // Blog Medium, News
    add_image_size(‘px_media_4’, 325, 244, true);
    // Admin scripts enqueue
    function px_admin_scripts_enqueue() {
    $template_path = get_template_directory_uri() . ‘/scripts/admin/media_upload.js’;
    wp_enqueue_script(‘my-upload’, $template_path,
    array(‘jquery’, ‘media-upload’, ‘thickbox’, ‘jquery-ui-droppable’, ‘jquery-ui-datepicker’, ‘jquery-ui-slider’, ‘wp-color-picker’));
    wp_enqueue_script(‘custom_wp_admin_script’, get_template_directory_uri() . ‘/scripts/admin/px_functions.js’);
    wp_enqueue_style(‘custom_wp_admin_style’, get_template_directory_uri() . ‘/css/admin/admin-style.css’, array(‘thickbox’));
    wp_enqueue_style(‘custom_wp_admin_fontawesome_style’, get_template_directory_uri() . ‘/css/admin/font-awesome.css’, array(‘thickbox’));
    wp_enqueue_style(‘wp-color-picker’);

    }

    // Backend functionality files
    require_once (TEMPLATEPATH . ‘/include/theme_activation.php’);
    require_once (TEMPLATEPATH . ‘/include/admin_functions.php’);
    require_once (TEMPLATEPATH . ‘/include/theme_colors.php’);
    require_once (TEMPLATEPATH . ‘/include/player.php’);
    require_once (TEMPLATEPATH . ‘/include/pointtable.php’);
    require_once (TEMPLATEPATH . ‘/include/event.php’);
    require_once (TEMPLATEPATH . ‘/include/gallery.php’);
    require_once (TEMPLATEPATH . ‘/include/page_builder.php’);
    require_once (TEMPLATEPATH . ‘/include/post_meta.php’);
    require_once (TEMPLATEPATH . ‘/include/widgets.php’);
    require_once (TEMPLATEPATH . ‘/include/ical/iCalcreator.class.php’);
    require_once (TEMPLATEPATH . ‘/include/mailchimpapi/mailchimpapi.class.php’);
    require_once (TEMPLATEPATH . ‘/include/mailchimpapi/chimp_mc_plugin.class.php’);

    /* Require Woocommerce */
    require_once (TEMPLATEPATH . ‘/include/config_woocommerce/config.php’);
    require_once (TEMPLATEPATH . ‘/include/config_woocommerce/product_meta.php’);
    /* Addmin Menu PX Theme Option */

    if (current_user_can(‘administrator’)) {
    require_once (TEMPLATEPATH . ‘/include/theme_option.php’);
    add_action(‘admin_menu’, ‘px_theme’);
    function px_theme() {
    add_theme_page(‘PX Theme Option’, __(‘PX Theme Option’,’Kingsclub’), ‘read’, ‘px_theme_options’, ‘theme_option’);
    add_theme_page( « PX Import Demo Data » , __(« Import Demo Data » ,’Kingsclub’),’read’, ‘px_demo_importer’ , ‘px_demo_importer’);
    }

    }
    $image_url = apply_filters( ‘taxonomy-images-queried-term-image-url’,  », array(
    ‘image_size’ => ‘medium’
    ) );

    // Template redirect in single Gallery and Slider page
    function px_slider_gallery_template_redirect(){

    if ( get_post_type() == « px_gallery » ) {
    global $wp_query;
    $wp_query->set_404();
    status_header( 404 );
    get_template_part( 404 );
    exit();
    }
    }

    // enque style and scripts
    function px_front_scripts_enqueue() {
    global $px_theme_option;

    if (!is_admin()) {
    //wp_enqueue_style(‘style_css’, get_template_directory_uri() . ‘/style.css’);
    wp_enqueue_style(‘style_css’, get_stylesheet_uri());
    if ( isset($px_theme_option) && $px_theme_option == « on » ) {
    wp_enqueue_style(‘color-switcher_css’, get_template_directory_uri() . ‘/css/color-switcher.css’);
    }
    wp_enqueue_style(‘prettyPhoto_css’, get_template_directory_uri() . ‘/css/prettyphoto.css’);
    wp_enqueue_style(‘bootstrap_css’, get_template_directory_uri() . ‘/css/bootstrap.css’);
    wp_enqueue_style(‘font-awesome_css’, get_template_directory_uri() . ‘/css/font-awesome.css’);

    // Enqueue stylesheet
    wp_enqueue_style( ‘wp-mediaelement’ );
    wp_enqueue_script(‘jquery’);
    wp_enqueue_script( ‘wp-mediaelement’ );
    wp_enqueue_script(‘bootstrap_js’, get_template_directory_uri() . ‘/scripts/frontend/bootstrap.min.js’,  »,  », true);
    wp_enqueue_script(‘modernizr_js’, get_template_directory_uri() . ‘/scripts/frontend/modernizr.js’,  »,  », true);
    wp_enqueue_script(‘prettyPhoto_js’, get_template_directory_uri() . ‘/scripts/frontend/jquery.prettyphoto.js’,  »,  », true);
    wp_enqueue_script(‘functions_js’, get_template_directory_uri() . ‘/scripts/frontend/functions.js’, ‘0’,  », false);

    if ( isset($px_theme_option) && $px_theme_option == « on »){
    wp_enqueue_style(‘rtl_css’, get_template_directory_uri() . ‘/css/rtl.css’);
    }

    if ( isset($px_theme_option) && $px_theme_option == « on ») {
    echo  »;
    wp_enqueue_style(‘responsive_css’, get_template_directory_uri() . ‘/css/responsive.css’);
    }
    }
    }
    function px_enqueue_flexslider_script(){
    wp_enqueue_style(‘flexslider_css’, get_template_directory_uri() . ‘/css/flexslider.css’);
    wp_enqueue_script(‘flexslider_js’, get_template_directory_uri() . ‘/scripts/frontend/jquery.flexslider-min.js’,  »,  », true);
    }
    // cycle Script Enqueue
    function px_enqueue_cycle_script(){
    wp_enqueue_script(‘jquery.cycle2_js’, get_template_directory_uri() . ‘/scripts/frontend/cycle2.js’,  »,  », true);
    }

    // rating script
    function px_enqueue_rating_style_script(){
    wp_enqueue_style(‘jRating_css’, get_template_directory_uri() . ‘/css/jRating.jquery.css’);
    wp_enqueue_script(‘jquery_rating_js’, get_template_directory_uri() . ‘/scripts/frontend/jRating.jquery.js’,  »,  », true);
    }
    // Validation Script Enqueue
    function px_enqueue_validation_script(){
    wp_enqueue_script(‘jquery.validate.metadata_js’, get_template_directory_uri() . ‘/scripts/admin/jquery.validate.metadata.js’,  »,  », true);
    wp_enqueue_script(‘jquery.validate_js’, get_template_directory_uri() . ‘/scripts/admin/jquery.validate.js’,  »,  », true);
    }
    /* countdown enqueue */
    function px_enqueue_countdown_script(){
    wp_enqueue_script(‘jquery.countdown_js’, get_template_directory_uri() . ‘/scripts/frontend/jquery.countdown.js’,  »,  », true);
    }

    // add this share enqueue
    function px_addthis_script_init_method(){

    if( is_single()){
    wp_enqueue_script( ‘px_addthis’, ‘http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e4412d954dccc64&rsquo;,  »,  », true);
    }

    }
    // content class

    if ( ! function_exists( ‘px_meta_content_class’ ) ) {
    function px_meta_content_class(){
    global $px_meta_page;

    if ( $px_meta_page->sidebar_layout->px_layout ==  » or $px_meta_page->sidebar_layout->px_layout == ‘none’ ) {
    $content_class = « col-md-12 »;

    } else
    if ( $px_meta_page->sidebar_layout->px_layout  » and $px_meta_page->sidebar_layout->px_layout == ‘right’ ) {
    $content_class = « col-md-9 »;

    } else
    if ( $px_meta_page->sidebar_layout->px_layout  » and $px_meta_page->sidebar_layout->px_layout == ‘left’ ) {
    $content_class = « col-md-9 »;

    } else
    if ( $px_meta_page->sidebar_layout->px_layout  » and ($px_meta_page->sidebar_layout->px_layout == ‘both’ or $px_meta_page->sidebar_layout->px_layout == ‘both_left’ or $px_meta_page->sidebar_layout->px_layout == ‘both_right’)) {
    $content_class = « col-md-6 »;

    } else {
    $content_class = « col-md-12 »;
    }

    return $content_class;
    }

    }

    // Content pages Meta Class

    if ( ! function_exists( ‘px_default_pages_meta_content_class’ ) ) {

    function px_default_pages_meta_content_class($layout){

    if ( $layout ==  » or $layout == ‘none’ ) {

    echo « col-md-12 »;

    }

    else if ( $layout  » and $layout == ‘right’ ) {

    echo « content-left col-md-9 »;

    }

    else if ( $layout  » and $layout == ‘left’ ) {

    echo « content-right col-md-9 »;

    }

    else if ( $layout  » and $layout == ‘both’ ) {

    echo « content-right col-md-6 »;

    }

    }

    }

    #1064670
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Partie 2:

    // Favicon and header code in head tag//
    function px_footer_settings() {
    global $px_theme_option;
    if(isset($px_theme_option))
    echo htmlspecialchars_decode($px_theme_option);
    }

    /* Page Sub header title and subtitle */
    function get_subheader_title(){
    global $post, $wp_query;
    $show_title=true;
    $get_title =  »;
    if (is_page() || is_single()) {

    if (is_page() ){
    $px_xmlObject = px_meta_page(‘px_page_builder’);
    if (isset($px_xmlObject)) {
    if($px_xmlObject->page_title == « on »){
    echo ‘

    ‘ . get_the_title(). ‘

    ‘;
    }
    }else{
    echo ‘

    ‘ . get_the_title(). ‘

    ‘;
    }
    }elseif (is_single()) {

    $post_type = get_post_type($post->ID);
    if ($post_type == « events ») {
    $post_type = « px_event_meta »;
    } else if($post_type == « player »){
    $post_type = « player »;
    } else {
    $post_type = « post »;
    }
    $post_xml = get_post_meta($post->ID, $post_type, true);

    if ($post_xml «  ») {
    $px_xmlObject = new SimpleXMLElement($post_xml);
    }
    if (isset($px_xmlObject)) {
    echo ‘

    ‘ . get_the_title(). ‘

    ‘;
    }else{
    echo ‘

    ‘ . get_the_title(). ‘

    ‘;
    }
    }

    } else {
    ?>

    <?php
    }

    }

    // search varibales start
    function px_get_search_results($query) {

    if ( !is_admin() and (is_search())) {
    $query->set( ‘post_type’, array(‘post’, ‘events’, ‘player’) );
    remove_action( ‘pre_get_posts’, ‘px_get_search_results’ );
    }

    }

    // Filter shortcode in text areas

    if ( ! function_exists( ‘px_textarea_filter’ ) ) {

    function px_textarea_filter($content= »){
    return do_shortcode($content);
    }

    }

    // woocommerce ajax add to Cart
    function woocommerce_header_add_to_cart_fragment( $fragments ) {

    if ( class_exists( ‘woocommerce’ ) ){
    global $woocommerce;
    ob_start();
    ?>

    <a href="cart->get_cart_url(); ?> »>
    cart->cart_contents_count; ?>

    <?php
    $fragments = ob_get_clean();
    return $fragments;
    }

    }
    // woocommerce default cart
    function px_woocommerce_header_cart() {

    if ( class_exists( ‘woocommerce’ ) ){
    global $woocommerce;
    ?>

    <a href="cart->get_cart_url(); ?> »>
    cart->cart_contents_count; ?>

    <?php
    }

    }

    // Display navigation to next/previous for single posts

    if ( ! function_exists( ‘px_next_prev_post’ ) ) {

    function px_next_prev_post(){
    global $post;
    posts_nav_link();
    // Don’t print empty markup if there’s nowhere to navigate.
    $previous = ( is_attachment() ) ? get_post( $post->post_parent ) :
    get_adjacent_post( false,  », true );
    $next = get_adjacent_post( false,  », false );
    echo ‘

    ‘;
    previous_post_link( ‘%link’, ‘‘ );
    next_post_link( ‘%link’,’‘ );
    echo ‘

    ‘;
    }

    }
    function px_posts_link_next_class($format){
    $format = str_replace(‘href=’, ‘class= »post-next » href=’, $format);
    return $format;
    }
    add_filter(‘next_post_link’, ‘px_posts_link_next_class’);

    function px_posts_link_prev_class($format) {
    $format = str_replace(‘href=’, ‘class= »post-prev » href=’, $format);
    return $format;
    }
    add_filter(‘previous_post_link’, ‘px_posts_link_prev_class’);
    // Add Featured/sticky text/icon for sticky posts.
    if ( ! function_exists( ‘px_featured()’ ) ) {
    function px_featured(){
    global $px_transwitch,$px_theme_option;

    if ( is_sticky() ){
    ?>

  • <?php
    }

    }

    }

    /* display post page title */
    function px_post_page_title(){

    if ( is_author() ) {
    global $author;
    $userdata = get_userdata($author);
    echo __(‘Author’, ‘Kingsclub’) .  »  » . __(‘Archives’, ‘Kingsclub’) . « : « .$userdata->display_name;
    }
    elseif ( is_tag() || is_tax(‘event-tag’) || is_tax(‘portfolio-tag’) || is_tax(‘sermon-tag’) ) {
    echo __(‘Tags’, ‘Kingsclub’) .  »  » . __(‘Archives’, ‘Kingsclub’) . « :  » . single_cat_title(  », false );
    }
    elseif ( is_category() || is_tax(‘event-category’) || is_tax(‘portfolio-category’) || is_tax(‘season-category’) ||
    is_tax(‘sermon-series’) || is_tax(‘sermon-pastors’) ) {
    echo __(‘Categories’, ‘Kingsclub’) .  »  » . __(‘Archives’, ‘Kingsclub’) . « :  » . single_cat_title(  », false );
    }
    elseif( is_search()){
    printf( __( ‘Search Results %1$s %2$s’, ‘Kingsclub’ ), ‘: ‘,’‘ . get_search_query() . ‘‘ );
    }
    elseif ( is_day() ) {
    printf( __( ‘Daily Archives: %s’, ‘Kingsclub’ ), ‘‘ . get_the_date() . ‘‘ );
    }
    elseif ( is_month() ) {
    printf( __( ‘Monthly Archives: %s’, ‘Kingsclub’ ), ‘‘ . get_the_date( _x( ‘F Y’, ‘monthly archives date format’, ‘Kingsclub’ ) ) . ‘‘ );
    }
    elseif ( is_year() ) {
    printf( __( ‘Yearly Archives: %s’, ‘Kingsclub’ ), ‘‘ . get_the_date( _x( ‘Y’, ‘yearly archives date format’, ‘Kingsclub’ ) ) . ‘‘ );
    }
    elseif ( is_404()){
    _e( ‘Error 404’, ‘Kingsclub’ );
    }

    }

    // Custom excerpt function
    function px_get_the_excerpt($limit,$readmore =  », $dottedline =  ») {
    global $px_theme_option;
    $readmore =  »;
    if(isset($px_theme_option) && $px_theme_option == « on »){
    $readmore = __(‘Read More’,’Kingsclub’);
    } else {
    if(isset($px_theme_option))
    $readmore = $px_theme_option;
    }
    if(!isset($limit) || $limit ==  »){ $limit = ‘255’;}
    $get_the_excerpt = trim(preg_replace(‘/]*>(.*)/iU’,  », get_the_excerpt()));

    if(isset($dottedline) && $dottedline  »){
    echo ‘

    ‘.substr($get_the_excerpt, 0, « $limit »);
    echo $dottedline;
    echo ‘

    ‘;
    } else {
    echo ‘

    ‘.substr($get_the_excerpt, 0, « $limit »).’

    ‘;
    if (strlen($get_the_excerpt) > « $limit ») {

    if($readmore == « true »){
    echo ‘… ‘ . $readmore . ‘‘;
    }

    }
    }

    }

    // change the default query variable start
    function px_change_query_vars($query) {

    if (is_search() || is_home()) {

    if (empty($_GET))$_GET = 1;
    $query->query_vars = $_GET;
    }
    return $query;
    // Return modified query variables
    }

    /* custom pagination start */

    if ( ! function_exists( ‘px_pagination’ ) ) {
    function px_pagination($total_records, $per_page, $qrystr =  ») {
    $html =  »;
    $dot_pre =  »;
    $dot_more =  »;
    $previous = __(« Previous »,’Kingsclub’);
    if(isset($px_theme_option[« trans_switcher »]) && $px_theme_option[« trans_switcher »] == « on ») { $previous = __(« Previous »,’Kingsclub’); }elseif(isset($px_theme_option[« trans_previous »]) && $px_theme_option[« trans_previous »]  »){ $previous = $px_theme_option[« trans_previous »];}
    $total_page = ceil($total_records / $per_page);
    $loop_start = $_GET – 2;
    $loop_end = $_GET + 2;

    if ($_GET < 3) {
    $loop_start = 1;

    if ($total_page < 5)$loop_end = $total_page; else $loop_end = 5;
    } else
    if ($_GET >= $total_page – 1) {

    if ($total_page < 5)$loop_start = 1; else $loop_start = $total_page – 4;
    $loop_end = $total_page;
    }

    if ($_GET > 1)$html .= « 

    « ;

    if ($_GET > 3 and $total_page > 5)$html .= « 

  • 1
  • « ;

    if ($_GET > 4 and $total_page > 6)$html .= « 

  • . . .
  • « ;

    if ($total_page > 1) {
    for ($i = $loop_start; $i <= $loop_end; $i++) {

    if ($i $_GET)$html .= « 

  •  » . $i . « 
  • « ; else $html .= « 

  •  » . $i . « 
  • « ;
    }

    }

    if ($loop_end $total_page and $loop_end $total_page – 1)$html .= « 

  • . . .
  • « ;

    if ($loop_end $total_page)$html .= « 

  • $total_page
  • « ;

    if ($_GET < $total_records / $per_page)$html .= "

    « ;
    return $html;
    }

    }
    // pagination end
    // Social Share Function

    if ( ! function_exists( ‘px_social_share’ ) ) {
    function px_social_share($icon_type =  », $title=’true’) {
    global $px_theme_option;
    px_addthis_script_init_method();
    if (isset($px_theme_option) && $px_theme_option == « on »){
    if(isset($px_theme_option) && $px_theme_option[« trans_switcher »] == « on ») { $html1= __(« Share this post »,’Kingsclub’); }else{ $html1 = $px_theme_option[« trans_share_this_post »];}
    $html =  »;
    $html .=’

    ‘;

    echo $html;

    }
    }

    }

    // Social network

    if ( ! function_exists( ‘px_social_network’ ) ) {
    function px_social_network($icon_type= »,$tooltip =  »){
    global $px_theme_option;
    $tooltip_data= »;
    if($icon_type==’large’){
    $icon = ‘2x’;
    } else {
    $icon = ‘icon’;
    }
    echo ‘

    ‘;
    if(isset($tooltip) && $tooltip  »){
    $tooltip_data=’data-placement-tooltip= »tooltip »‘;
    }
    if ( isset($px_theme_option) and count($px_theme_option) > 0 ) {
    $i = 0;
    foreach ( $px_theme_option as $val ){
    if($val !=  »){ ?>
    <a title="" href=" » data-original-title= » » data-placement= »top » class= »colrhover » target= »_blank »>
    <?php if($px_theme_option[$i]  » && isset($px_theme_option[$i])){ ?>
    <i class="fa « >
    <img src=" » alt= » » />
    <?php
    }
    $i++;
    }
    }
    echo ‘

    ‘;
    }
    }

    // Post image attachment function
    function px_attachment_image_src($attachment_id, $width, $height) {
    $image_url = wp_get_attachment_image_src((int)$attachment_id, array($width, $height), true);

    if ($image_url[1] == $width and $image_url[2] == $height); else
    $image_url = wp_get_attachment_image_src((int)$attachment_id, « full », true);
    $parts = explode(‘/uploads/’,$image_url[0]);

    if ( count($parts) > 1 ) return $image_url[0];
    }

    // Post image attachment source function
    function px_get_post_img_src($post_id, $width, $height) {

    if(has_post_thumbnail()){
    $image_id = get_post_thumbnail_id($post_id);
    $image_url = wp_get_attachment_image_src((int)$image_id, array($width, $height), true);

    if ($image_url[1] == $width and $image_url[2] == $height) {
    return $image_url[0];
    } else {
    $image_url = wp_get_attachment_image_src((int)$image_id, « full », true);
    return $image_url[0];
    }

    }

    }

    // Get Post image attachment
    function px_get_post_img($post_id, $width, $height) {
    $image_id = get_post_thumbnail_id($post_id);
    $image_url = wp_get_attachment_image_src((int)$image_id, array($width, $height), true);
    if ($image_url[1] == $width and $image_url[2] == $height) {
    return get_the_post_thumbnail($post_id, array($width, $height));
    } else {
    return get_the_post_thumbnail($post_id, « full »);
    }
    }
    // custom sidebar start
    $px_theme_option = get_option(‘px_theme_option’);

    if ( isset($px_theme_option) and !empty($px_theme_option)) {
    foreach ( $px_theme_option as $sidebar ){
    register_sidebar(
    array(
    ‘name’ => $sidebar,
    ‘id’ => $sidebar,
    ‘description’ => ‘This widget will be displayed on right side of the page.’,
    ‘before_widget’ => ‘

    ‘,
    ‘after_widget’ => ‘

    ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘


    )
    );
    }

    }
    register_sidebar(
    array(
    ‘name’ => ‘Sidebar Widget’,
    ‘id’ => ‘sidebar-1’,
    ‘description’ => ‘This Widget Show the Content in Blog Listing page.’,
    ‘before_widget’ => ‘

    ‘,
    ‘after_widget’ => ‘

    ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘


    )
    );
    // Home top widget area
    register_sidebar(
    array(
    ‘name’ => ‘Home Top Widget’,
    ‘id’ => ‘home-top-widget’,
    ‘description’ => ‘This Widget Show the Content in Hom Page’,
    ‘before_widget’ => ‘

    ‘,
    ‘after_widget’ => ‘

    ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘


    )
    );
    //footer widget

    register_sidebar( array(

    ‘name’ => ‘Footer Widget’,

    ‘id’ => ‘footer-widget’,

    ‘description’ => ‘This Widget Show the Content in Footer Area.’,

    ‘before_widget’ => ‘

    ‘,

    ‘after_widget’ => ‘

    ‘,

    ‘before_title’ => ‘

    ‘,

    ‘after_title’ => ‘

    ) );

    register_sidebar( array(

    ‘name’ => ‘Header Advertisement Widget’,

    ‘id’ => ‘header-advertisement-widget’,

    ‘description’ => ‘This Widget Show the Content in Header Area.’,

    ‘before_widget’ => ‘

    ‘,

    ‘after_widget’ => ‘

    ‘,

    ‘before_title’ => ‘

    ‘,

    ‘after_title’ => ‘

    ) );
    register_sidebar( array(

    ‘name’ => ‘Footer Advertisement Widget’,

    ‘id’ => ‘footer-advertisement-widget’,

    ‘description’ => ‘This Widget Show the Content in Footer Area.’,

    ‘before_widget’ => ‘

    ‘,

    ‘after_widget’ => ‘

    ‘,

    ‘before_title’ => ‘

    ‘,

    ‘after_title’ => ‘

    ) );

#1064671
Frank Lulla
Participant
Initié WordPress
26 contributions

Partie 3:

function px_add_menuid($ulid) {
return preg_replace(‘/

    /’, ‘


  • <?php printf( __( '%s', 'Kingsclub' ), sprintf( '

    %s

    ‘, get_comment_author_link() ) ); /* translators: 1: date, 2: time */ printf( __( ‘%1$s
    ‘, ‘Kingsclub’ ), get_comment_date());
    ?>

    $depth, ‘max_depth’ => $args ) ) ); if ( $comment->comment_approved == ‘0’ ) : ?>

<?php
break;
case ‘pingback’ :
case ‘trackback’ :
?>

  • <?php
    break;
    endswitch;
    }
    endif;
    // password protect post/page

    if ( ! function_exists( ‘px_password_form’ ) ) {
    function px_password_form() {
    global $post,$px_theme_option;
    $label = ‘pwbox-‘.( empty( $post->ID ) ? rand() :
    $post->ID );
    $o = ‘

    ‘ . __( « This post is password protected. To view it please enter your password below: »,’Kingsclub’ ) . ‘

    ‘;
    $o .= ‘

    ‘;
    return $o;
    }

    }

    // breadcrumb function

    if ( ! function_exists( ‘px_breadcrumbs’ ) ) {

    function px_breadcrumbs() {
    global $wp_query;
    /* === OPTIONS === */
    $text = ‘Home’;
    // text for the ‘Home’ link
    $text = ‘%s’;
    // text for a category page
    $text = ‘%s’;
    // text for a search results page
    $text = ‘%s’;
    // text for a tag page
    $text = ‘%s’;
    // text for an author page
    $text = ‘Error 404’;
    // text for the 404 page
    $showCurrent = 1;
    // 1 – show current post/page title in breadcrumbs, 0 – don’t show
    $showOnHome = 1;
    // 1 – show breadcrumbs on the homepage, 0 – don’t show
    $delimiter =  »;
    // delimiter between crumbs
    $before = ‘

  • ‘;
    // tag before the current crumb
    $after = ‘
  • ‘;
    // tag after the current crumb
    /* === END OF OPTIONS === */
    global $post,$px_theme_option;
    $current_page = __(« Current Page »,’Kingsclub’);;
    if(isset($px_theme_option[« trans_switcher »]) && $px_theme_option[« trans_switcher »] == « on ») { $current_page = __(« Current Page »,’Kingsclub’); }else if(isset($px_theme_option[« trans_currentpage »])){ $current_page = $px_theme_option[« trans_currentpage »];}
    $homeLink = home_url() . ‘/’;
    $linkBefore = ‘

  • ‘;
    $linkAfter = ‘
  • ‘;
    $linkAttr =  »;
    $link = $linkBefore . ‘%2$s‘ . $linkAfter;
    $linkhome = $linkBefore . ‘%2$s‘ . $linkAfter;

    if (is_home() || is_front_page()) {

    if ($showOnHome == « 1 ») echo ‘

    ‘;
    } else {
    echo ‘

    ‘;
    }

    }

    }

    if ( ! function_exists( ‘px_logo’ ) ) {
    function px_logo($logo_url, $log_width, $logo_height){
    ?>
    <a href=" »>
    <img src=" » style= »width:px; height:px »
    alt= » » />

    <?php
    }

    }
    /*Top and Main Navigation*/
    if ( ! function_exists( ‘px_navigation’ ) ) {
    function px_navigation($nav= », $menus = ‘menus’){
    //sf_mega_menu_walker
    //new px_mega_menu_walker()
    global $px_theme_option;
    // Menu parameters
    if ( has_nav_menu( $nav ) ) {
    $defaults = array(‘theme_location’ => « $nav »,’menu’ =>  »,’container’ =>  »,’container_class’ =>  »,’container_id’ =>  »,’menu_class’ =>  »,’menu_id’ => « $menus »,’echo’ => false,’fallback_cb’ => ‘wp_page_menu’,’before’ =>  »,’after’ =>  »,’link_before’ =>  »,’link_after’ =>  »,’items_wrap’ => ‘

      %3$s

    ‘,’depth’ => 0,’walker’ =>  »);
    } else {
    $defaults = array(‘theme_location’ => « primary »,’menu’ =>  »,’container’ =>  »,’container_class’ =>  »,’container_id’ =>  »,’menu_class’ =>  »,’menu_id’ => « $menus »,’echo’ => false,’fallback_cb’ => ‘wp_page_menu’,’before’ =>  »,’after’ =>  »,’link_before’ =>  »,’link_after’ =>  »,’items_wrap’ => ‘

      %3$s

    ‘,’depth’ => 0,’walker’ =>  »);
    }

    echo do_shortcode(wp_nav_menu($defaults));
    }

    }
    // Column shortcode with 2/3/4 column option even you can use shortcode in column shortcode

    if ( ! function_exists( ‘px_column_page’ ) ) {
    function px_column_page(){
    global $px_node;
    $html = ‘

    column_element_size.’ column »>’;
    $html .= do_shortcode($px_node->column_text);
    $html .= ‘

    ‘;
    echo $html;
    }

    }

    // Get post meta in xml form
    function px_meta_page($meta) {
    global $px_meta_page;
    $meta = get_post_meta(get_the_ID(), $meta, true);
    if ($meta  ») {
    $px_meta_page = new SimpleXMLElement($meta);
    return $px_meta_page;
    }

    }
    // woocommerce shop meta
    function px_meta_shop_page($meta, $id) {
    global $px_meta_page;
    $meta = get_post_meta($id, $meta, true);
    if ($meta  ») {
    $px_meta_page = new SimpleXMLElement($meta);
    return $px_meta_page;
    }
    }

    #1064672
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Parite 4:

    function px_author_description(){
    if (get_the_author_meta(‘description’)){ ?>


    <a href=" » class= »float-left »>

    <a class="colrhover" href=" »>

    <?php if(get_the_author_meta('flicker')  »){?><a href=" »>
    <?php if(get_the_author_meta('twitter')  »){?><a href=" »>
    <?php if(get_the_author_meta('facebook')  »){?><a href=" »>
    <?php if(get_the_author_meta('googleplus')  »){?><a href=" »>
    <?php if(get_the_author_meta('linkedin')  »){?><a href=" »>


    <?php
    }
    }

    //
    function px_next_prev_custom_links($post_type = ‘pointable’){
    global $post;
    $previd = $nextid =  »;
    $post_categoryy =  »;
    if($post_type == ‘events’){
    $post_categoryy = ‘event-category’;
    } else if($post_type == ‘events’){
    $post_categoryy = ‘season-category’;
    } else if($post_type == ‘player’){
    $post_categoryy = ‘team-category’;
    } else {
    $post_categoryy = ‘category’;
    }

    $count_posts = wp_count_posts( « $post_type » )->publish;
    $px_postlist_args = array(
    ‘posts_per_page’ => -1,
    ‘order’ => ‘ASC’,
    ‘post_type’ => « $post_type »,
    );
    $px_postlist = get_posts( $px_postlist_args );

    $ids = array();
    foreach ($px_postlist as $px_thepost) {
    $ids[] = $px_thepost->ID;
    }
    $thisindex = array_search($post->ID, $ids);
    if(isset($ids[$thisindex-1])){
    $previd = $ids[$thisindex-1];
    }
    if(isset($ids[$thisindex+1])){
    $nextid = $ids[$thisindex+1];
    }
    ?>

    <?php
    if (isset($previd) && !empty($previd) && $previd >=0 ) {
    ?>

    <?php
    }

    if (isset($nextid) && !empty($nextid) ) {
    ?>

    <?php
    }
    ?>

    <?php
    wp_reset_query();
    }

    // news announcement
    if ( ! function_exists( ‘fnc_announcement’ ) ) {
    function fnc_announcement(){
    global $post,$px_theme_option;
    date_default_timezone_set(‘UTC’);
    $current_time = strtotime(current_time(‘m/d/Y H:i’, $gmt = 0));
    $image_url =  »;
    if (isset($px_theme_option) and $px_theme_option==’Fixtures’){
    $meta_compare = « > »;
    }elseif(isset($px_theme_option) and $px_theme_option==’Results’){
    $meta_compare = « <";
    }else{
    $meta_compare = « > »;
    }
    if (isset($px_theme_option) and $px_theme_option » and $px_theme_option’0′){
    $fixture_order = $px_theme_option;
    }else{
    $fixture_order = ‘ASC’;
    }

    if(isset($px_theme_option) && $px_theme_option ‘0’){
    $fixture_category = $px_theme_option;
    $announcement_no_posts = $px_theme_option;
    if (empty($announcement_no_posts)){ $announcement_no_posts = 10;}
    if(isset($px_theme_option) and $px_theme_option==’All’){
    $args = array(
    ‘posts_per_page’ => « $announcement_no_posts »,
    ‘paged’ => ‘1’,
    ‘post_type’ => ‘events’,
    ‘post_status’ => ‘publish’,
    ‘meta_key’ => ‘px_event_from_date_time’,
    //’meta_value’ => $current_time,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => « $fixture_order »,
    );
    }else{
    $args = array(
    ‘posts_per_page’ => « $announcement_no_posts »,
    ‘paged’ => ‘1’,
    ‘post_type’ => ‘events’,
    ‘post_status’ => ‘publish’,
    ‘meta_key’ => ‘px_event_from_date_time’,
    ‘meta_value’ => $current_time,
    ‘meta_compare’ => $meta_compare,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => « $fixture_order »,
    );
    }
    if(isset($fixture_category) && $fixture_category  » && $fixture_category ‘0’ && $fixture_category ‘All’ ){
    $event_category_array = array(‘event-category’ => « $fixture_category »);
    $args = array_merge($args, $event_category_array);
    }
    $custom_query = new WP_Query($args);
    $count_post = $custom_query->post_count;
    if($announcement_no_posts==’-1′){
    $announcement_no_posts = $count_post;
    }
    if($custom_query->have_posts()):
    px_enqueue_cycle_script();
    // echo ‘

    ';
    //print_r($custom_query );
    // echo '';
    ?>






    <?php endif; wp_reset_query();
    }
    }
    }
    // posts/pages title lenght limit
    function px_title_lenght($str ='',$start =0,$length =30){
    return substr($str,$start,$length);
    }
    // Default pages listing article
    function px_defautlt_artilce(){
    global $post,$px_theme_option;
    $img_class = '';
    $image_url = px_attachment_image_src(get_post_thumbnail_id($post->ID), 325, 244);
    if($image_url == ""){
    $img_class = 'no-image';
    }
    ?>
    <article id="post-" >
    <?php if($image_url ""){?>
    <a href=""><img src="" alt="">



    <a href="" class="pix-colrhvr">





    <a href="" class="btnreadmore btn pix-bgcolrhvr">




    <?php

    }
    // header search function
    function px_search(){
    ?>
    <form id="searchform" method="get" action="" role="search">

    <input name="s" id="searchinput" value="" type="text" />

    <?php

    }
    // post date/categories/tags
    if ( ! function_exists( 'px_posted_on' ) ) {
    function px_posted_on($cat=true,$tag=true,$comment=true,$date=true,$author=true,$icon=true,$date=true){
    global $px_theme_option;
    ?>




    • <?php if($icon==true){ echo ''; } ?>
      <time datetime="">

    • <?php
      }
      /* translators: used between list items, there is a space after the comma */
      $trans_in = "";
      if($cat==true){
      if(isset($px_theme_option) && $px_theme_option == "on"){ $trans_in =__('in','Kingsclub');}else{ if(isset($px_theme_option)) $trans_in = $px_theme_option; }
      $before_cat = "
    • ".$trans_in." ";
      $categories_list = get_the_term_list ( get_the_id(), 'category', $before_cat, ', ', '
    • ' );
      if ( $categories_list ){
      printf( __( '%1$s', 'Kingsclub'),$categories_list );
      }
      }
      /* translators: used between list items, there is a space after the comma */
      if($tag == true){
      $before_tag = "
    • ".__( 'tags','Kingsclub')."";
      $tags_list = get_the_term_list ( get_the_id(), 'post_tag', $before_tag, ', ', '
    • ' );
      if ( $tags_list ){
      printf( __( '%1$s', 'Kingsclub'),$tags_list );
      } // End if categories
      }
      if($comment == true){
      if ( comments_open() ) {
      echo "
    • "; comments_popup_link( __( '0 Comment', 'Kingsclub' ) , __( '1 Comment', 'Kingsclub' ), __( '% Comments', 'Kingsclub' ) );
      }
      }



      edit_post_link( __( 'Edit', 'Kingsclub'), '
    • ', '
    • ' );
      ?>

    <?php
    }
    }
    // footer show partner
    function px_show_partner(){
    global $px_theme_option;
    $gal_album_db = '0';
    if(isset($px_theme_option))
    $gal_album_db =$px_theme_option;
    ?>
    <?php if($gal_album_db "0" and $gal_album_db ''){?>

    <?php
    if($px_theme_option ''){ ?>



    <?php }
    if($gal_album_db "0" and $gal_album_db ''){
    ?>






    <div class="cycle-slideshow"
    data-cycle-fx=carousel
    data-cycle-next="#cycle-nexto"
    data-cycle-prev="#cycle-prevt"
    data-cycle-slides=">article"
    data-cycle-timeout=0>

    <?php
    // galery slug to id start
    $args=array(
    'name' => (string)$gal_album_db,
    'post_type' => 'px_gallery',
    'post_status' => 'publish',
    'showposts' => 2,
    );
    $get_posts = get_posts($args);
    if($get_posts){
    $gal_album_db = (int)$get_posts[0]->ID;
    }
    // galery slug to id end
    $px_meta_gallery_options = get_post_meta($gal_album_db, "px_meta_gallery_options", true);
    // pagination start
    if ( $px_meta_gallery_options "" ) {
    px_enqueue_cycle_script();
    $xmlObject = new SimpleXMLElement($px_meta_gallery_options);
    $limit_start = 0;
    $limit_end = count($xmlObject);
    for ( $i = $limit_start; $i < $limit_end; $i++ ) {
    $path = $xmlObject->gallery[$i]->path;
    $title = $xmlObject->gallery[$i]->title;
    $description = $xmlObject->gallery[$i]->description;
    $use_image_as = $xmlObject->gallery[$i]->use_image_as;
    $video_code = $xmlObject->gallery[$i]->video_code;
    $link_url = $xmlObject->gallery[$i]->link_url;
    $image_url = px_attachment_image_src($path, 150, 150);
    $image_url_full = px_attachment_image_src($path, 0, 0);
    ?>

    <a href=""
    target="" >
    <?php echo "".$title.""; ?>


    <?php
    }
    } else {
    echo '

    '.__( 'No results found.', 'Kingsclub' ).'

    ';
    }
    ?>







    <?php }
    }
    #1064673
    Frank Lulla
    Participant
    Initié WordPress
    26 contributions

    Partie 5:

    //
    function px_footer_tweets($username =  », $numoftweets =  »){
    global $px_theme_option;

    if($numoftweets ==  » or !is_numeric($numoftweets)){$numoftweets = 1;}
    if(strlen($username) > 1){
    $consumerkey = isset($px_theme_option) ? $px_theme_option:  »;
    $consumersecret = isset($px_theme_option) ? $px_theme_option:  »;
    $accesstoken = isset($px_theme_option) ? $px_theme_option:  »;
    $accesstokensecret = isset($px_theme_option) ? $px_theme_option:  »;
    $px_cache_limit_time = isset($px_theme_option) ? $px_theme_option:  »;
    $px_tweet_num_from_twitter = isset($px_theme_option) ? $px_theme_option :  »;
    $px_twitter_datetime_formate = isset($px_theme_option) ? $px_theme_option :  »;

    if ($px_cache_limit_time ==  ») {
    $px_cache_limit_time = 60;
    }
    if ($px_twitter_datetime_formate ==  ») {
    $px_twitter_datetime_formate = ‘time_since’;
    }
    if ($px_tweet_num_from_twitter ==  ») {
    $px_tweet_num_from_twitter = 5;
    }
    //extract($args, EXTR_SKIP);
    if ($numoftweets ==  ») {
    $numoftweets = 2;
    }
    //if (strlen($username) > 1) {
    if($consumerkey  » && $consumersecret  » && $accesstoken  » && $accesstokensecret  ») {
    require_once get_template_directory() . ‘/include/twitteroauth/display-tweets.php’;
    display_tweets($username,$px_twitter_datetime_formate , $px_tweet_num_from_twitter, $numoftweets, $px_cache_limit_time);
    }
    else {
    echo ‘

    ‘.__(‘Please Set Twitter API’,’kc’).’

    ‘;
    }
    }

    /*if(strlen($username) > 1){
    echo « 

    ‘;
    }*/
    }

    // Player Detail Gallery

    function px_single_gallery($px_gallery_id= »){
    $args=array(
    ‘name’ => (string)$px_gallery_id,
    ‘post_type’ => ‘px_gallery’,
    ‘post_status’ => ‘publish’,
    ‘showposts’ => 1,
    );
    $get_posts = get_posts($args);

    if($get_posts){

    $gal_album_db = $get_posts[0]->ID;

    }
    if(isset($gal_album_db) && $gal_album_db  »)
    {
    $px_cause_gallery = get_post_meta((int)$gal_album_db, « px_meta_gallery_options », true);

    if ( $px_cause_gallery «  » ) {
    $px_image_per_gallery =  »;
    $px_xmlObject_gallery = new SimpleXMLElement($px_cause_gallery);
    $limit_start = 0;
    $limit_end = $limit_start+$px_image_per_gallery;
    if($limit_end < 1){
    $limit_end = count($px_xmlObject_gallery);
    }
    $count_post = count($px_xmlObject_gallery);
    ?>

    <?php

    }
    }
    }
    // Get object by slug
    function px_get_term_object($var_pb_event_category =  »){
    global $wpdb;
    return $row_cat = $wpdb->get_row(« SELECT * from « .$wpdb->prefix. »terms WHERE slug = ‘ » . $var_pb_event_category . »‘ » );
    }
    function px_fixtures_page($page_section_title =  »){
    global $px_node,$post, $px_theme_option,$px_counter_node;

    if($px_node->var_pb_fixtures_cat  » && $px_node->var_pb_fixtures_cat ‘0’){
    if(isset($px_theme_option[« trans_switcher »]) && $px_theme_option[« trans_switcher »] == « on ») { $start_fixtures = __(« Kick-off »,’Kingsclub’); }else{ if(isset($px_theme_option[« trans_event_start »]))$start_fixtures = $px_theme_option[« trans_event_start »];}
    ?>
    <div class="element_size_fixtures_element_size;?> »>

    var_pb_fixtures_view == ‘countdown’){
    $hours = ’00’;
    $mints = ’00’;
    $featured_args = array(
    ‘posts_per_page’ => « 1 »,
    // ‘paged’ => $_GET,
    ‘post_type’ => ‘events’,
    ‘event-category’ => « $px_node->var_pb_fixtures_cat »,
    ‘meta_key’ => ‘px_event_from_date’,
    ‘meta_value’ => date(‘m/d/Y’),
    ‘meta_compare’ => « >= »,
    ‘orderby’ => ‘meta_value’,
    ‘post_status’ => ‘publish’,
    ‘order’ => ‘ASC’,
    );
    $px_featured_post= new WP_Query($featured_args);
    while ($px_featured_post->have_posts()) : $px_featured_post->the_post();
    $event_from_date = get_post_meta($post->ID, « px_event_from_date », true);
    $year_event = date(« Y », strtotime($event_from_date));
    $month_event = date(« m », strtotime($event_from_date));
    $date_event = date(« d », strtotime($event_from_date));
    $px_featured_meta = get_post_meta($post->ID, « px_event_meta », true);
    if ( $px_featured_meta «  » ) {
    $px_featured_event_meta = new SimpleXMLElement($px_featured_meta);
    if ( $px_featured_event_meta->event_all_day != « on » ) {
    $time = $px_featured_event_meta->event_time;

    $time_param = str_replace(« PM »,  », $px_featured_event_meta->event_time);
    $time_param = str_replace(« AM »,  », $time_param);
    $time_param_array = explode(‘:’, $time_param);
    $pos = strpos($px_featured_event_meta->event_time, ‘PM’);
    if ($pos === false) {
    $hours = $time_param_array;
    $mints = $time_param_array;
    } else {
    $hours = $time_param_array+12;
    $mints = $time_param_array;
    }

    } else {
    $hours = ’00’;
    $mints = ’00’;

    }

    }
    $image_url = px_get_post_img_src($post->ID, ‘530’, ‘398’);
    px_enqueue_countdown_script();

    ?>
    var_pb_fixtures_title  » && $page_section_title ==  »){?>

    <a href=" »>var_pb_fixtures_title;?>

    <?php if($image_url  » && $page_section_title ==  »){?>

    <img src=" » alt= » »>

    var_pb_fixtures_title;?>

    <?php
    if ( $px_featured_event_meta->event_all_day != « on » ) {
    echo $px_featured_event_meta->event_time;
    }else{
    _e(« All »,’Kingsclub’) . printf( __(« %s day »,’Kingsclub’), ‘ ‘);
    }
    ?>

      var_pb_event_team1) && $px_featured_event_meta->var_pb_event_team1  » && $px_featured_event_meta->var_pb_event_team1 ‘0’){?>

    • <?php

      $team1_row = px_get_term_object($px_featured_event_meta->var_pb_event_team1);

      $team_img1 = px_team_data_front($team1_row->term_id);
      if($team_img1[0]  »){
      ?>
      <img alt="" src=" »>

    • <?php }

      ?>
      var_pb_event_team2) && $px_featured_event_meta->var_pb_event_team2  » && $px_featured_event_meta->var_pb_event_team2 ‘0’){?>

    • <?php
      $px_featured_event_meta->var_pb_event_team2;
      $team2_row = px_get_term_object($px_featured_event_meta->var_pb_event_team2);
      $team_img2 = px_team_data_front($team2_row->term_id);

      if($team_img2[0]  »){

      ?>
      <img alt="" src=" »>

    <?php
    if(isset($team1_row->name)){echo $team1_row->name;}
    ?>

    <?php echo $px_theme_option;
    if(isset($px_theme_option[« trans_switcher »]) && $px_theme_option[« trans_switcher »] == « on ») { _e(« VS »,’Kingsclub’); }else{ echo $px_theme_option[« trans_event_vs »];}
    ?>

    <?php
    if(isset($team2_row->name)){echo $team2_row->name;}
    ?>
    event_address;?>


    event_time_title) && $px_featured_event_meta->event_time_title  »){echo $px_featured_event_meta->event_time_title.’ ‘;}
    if ( isset($px_featured_event_meta->event_all_day) && $px_featured_event_meta->event_all_day != « on » ) {
    echo $px_featured_event_meta->event_time;
    }else{
    _e(« All »,’Kingsclub’) . printf( __(« %s day »,’Kingsclub’), ‘ ‘);
    }
    ?>

    <div class="defaultCountdown" id="defaultCountdown »>

    jQuery(document).ready(function($) {
    px_event_countdown( », », »,,, »);
    });

    <?php
    add_to_calender();
    if($px_featured_event_meta->event_ticket_options  »){?>

    <a class="btn pix-btn-open" href="event_buy_now;?> »> event_ticket_options) && $px_featured_event_meta->event_ticket_options  »){echo $px_featured_event_meta->event_ticket_options;}?>

    <?php
    endwhile;

    } else {
    $featured_args = array(
    ‘posts_per_page’ => « $px_node->var_pb_fixtures_per_page »,
    // ‘paged’ => $_GET,
    ‘post_type’ => ‘events’,
    ‘event-category’ => « $px_node->var_pb_fixtures_cat »,
    ‘meta_key’ => ‘px_event_from_date’,
    ‘meta_value’ => date(‘m/d/Y’),
    ‘meta_compare’ => « >= »,
    ‘orderby’ => ‘meta_value’,
    ‘post_status’ => ‘publish’,
    ‘order’ => ‘ASC’,
    );
    $px_featured_post= new WP_Query($featured_args);

    ?>
    var_pb_fixtures_title  »){?>

    var_pb_fixtures_title;?>

    have_posts() «  » ) {?>

    <?php
    while ( $px_featured_post->have_posts() ): $px_featured_post->the_post();
    $event_from_date = get_post_meta($post->ID, « px_event_from_date », true);

    $post_xml = get_post_meta($post->ID, « px_event_meta », true);
    if ( $post_xml «  » ) {
    $px_event_meta = new SimpleXMLElement($post_xml);
    $team1_row = px_get_term_object($px_event_meta->var_pb_event_team1);
    $team2_row = px_get_term_object($px_event_meta->var_pb_event_team2);
    }
    ?>

    <a href=" »>

    <?php
    if($px_event_meta->event_venue  » and $px_event_meta->event_venue ‘0’){
    echo ‘event_venue.' »>’.substr($px_event_meta->event_venue,0,1).’‘;
    } ?>


    • <?php
      if ( $px_event_meta->event_all_day != « on » ) {
      echo $px_event_meta->event_time;
      }else{
      _e(« All »,’Kingsclub’) . printf( __(« %s day »,’Kingsclub’), ‘ ‘);
      }
      ?>
    • event_ticket_options  »){?>

    • event_address;?>

    var_pb_fixtures_viewall_title  »){?> <a href="var_pb_fixtures_viewall_link;?> » class= »btn btn-viewall pix-bgcolrhvr »>var_pb_fixtures_viewall_title;?>l

    <?php

    wp_reset_query();
    }
    }

    15 sujets de 1 à 15 (sur un total de 27)
    • Vous devez être connecté pour répondre à ce sujet.