• Skip to primary navigation
  • Skip to main content
  • Skip to footer

altaneus

Pensées pour moi-même...

  • Home
  • Snippets
  • About

Amélioration: date de la dernière modification

23 November 2015 par Stefano

Nouvelle variante du post “Ajouter la date de la dernière modification d’un post“, compatible “schema.org” avec l’ajout de microcode pour les propriétés “dateModified” (type “Date”) et “editor” (type “Person”).

<?php

add_action ('genesis_entry_footer', 'summit_single_entry_footer_extra' );
function summit_single_entry_footer_extra() {
    $moddatetime = get_the_modified_time('c');
    $moddate = get_the_modified_date();
    $modauthor = get_the_modified_author();
    $outputmodified = '<time class="entry-modified-time" itemprop="dateModified" datetime="' . $moddatetime . '">' . $moddate . '</time>';
    $outputeditor = '<span class="entry-editor" itemprop="editor" itemscope itemtype="http://schema.org/Person"><span class="entry-editor-name" itemprop="name">' . esc_html( $modauthor ) . '</span></span>';
    echo '<div class="entry-footer-extra">';        
           echo '<p>Dernière modification le ' . $outputmodified . ' par ' . $outputeditor . '.</p>';
    echo '</div>';    
};

Références :

https://schema.org/Date
https://schema.org/editor

Filed Under: Genesis, Non classé

Gallery jQuery slider using bxslider

15 November 2015 par Stefano

Main reference for the bxSlider jQuery plugin:
http://bxslider.com/
https://github.com/stevenwanderski/bxslider-4

grab the latest files from the “dist” folder.

Examples with WordPress:
http://www.noeltock.com/web-design/wordpress/tutorial-wordpress-bxslider/
http://www.wrapcode.com/wordpress/custom-wordpress-content-slider-with-various-features-bxslider/

How to add a javascript to the WP_Footer
http://oikos.org.uk/2012/04/tech-notes-adding-scripts-using-wordpress-print_footer_scripts-hook/
https://gist.github.com/srikat/11533776

Ideas about the widget:
https://github.com/Automattic/jetpack/blob/master/modules/widgets/gallery.php
https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-includes/media.php
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/widgets/class-wp-widget-categories.php

Filed Under: Genesis, Non classé

Set the Jetpack Tiled Gallery Width

5 October 2015 par Stefano

There is a way to force the Jetpack Tiled Gallery with: it’s actually a filter to a function available in Jetpack.

Look for “$tiled_gallery_content_width” in the “tiled-gallery.php” module and you’ll notice that the default width is 500px.

https://github.com/Automattic/jetpack/blob/master/modules/tiled-gallery/tiled-gallery.php

Here’s how to change the tiled gallery size using a filter:

add_filter( 'tiled_gallery_content_width', 'personal_full_tiled_gallery_width' );
function personal_full_tiled_gallery_width( $width ) {
    $width = 1140;
    return $width;
}

Alternate way: redefine the global variable “$content_width” in the template.

See example here: https://developer.wordpress.com/themes/content-width/

References

http://hookr.io/filters/tiled_gallery_content_width/
http://www.functionsphp.com/jetpack-tiled-gallery-width/
http://wpsites.net/web-design/change-tiled-gallery-content-width-for-jetpacks-tiled-galleries/

Filed Under: Genesis, Non classé

Ajouter la date de la dernière modification d’un post

23 February 2015 par Stefano

Code à ajouter au fichier “function.php” (pour l’ensemble des posts) ou au fichier “single.php”, voire le template correspondant au “custom post”.

Ajout après le post

Dans ce cas de figure, le texte est intercalé après le post et avant le pied de page (footer).
Le contenu est englobé dans la classe CSS dédiée.

<?php // retirer cette ligne

/* ajoute la date de la dernière modification après le post */
add_action('genesis_after_entry_content', 'sdotta_add_after_entry_content');
function sdotta_add_after_entry_content() {
    if ( !is_page() ) {
        $moddate = get_the_modified_date();
        $modauthor = get_the_modified_author();
        echo '<div class="entry-content-extra">';
            echo '<p>Dernière modification le ' . $moddate . ' par ' . $modauthor . '.</p>';
        echo '</div>';
    }
};

Ajout après le contenu du pied de page (footer)

Dans ce cas de figure, le texte est ajouté à fin du contenu du pied de page (footer).
Le contenu est englobé dans la classe CSS dédiée.

<?php // retirer cette ligne

/* ajoute la date de la dernière modification après le pied de page du post */
add_action ('genesis_entry_footer', 'sdotta_add_entry_footer_content' );
function sdotta_add_entry_footer_content() {
    if ( !is_page() ) {
        $moddate = get_the_modified_date();
        $modauthor = get_the_modified_author();
        echo '<div class="entry-footer-extra">';
            echo '<p>Dernière modification le ' . $moddate . ' par ' . $modauthor . '.</p>';    
        echo '</div>';
    }
};

Ajout après le contenu du post

Dans ce cas de figure, le texte ajouté au contenu du post, et est toujours englobé dans la classe CSS “entry-content”.

<?php // retirer cette ligne

/* ajoute la date de la dernière modification à la fin du contenu du post */
add_filter('the_content', 'sdotta_add_extra_content');
function sdotta_add_extra_content( $content ) {
    if( is_singular() && is_main_query() ) {
    
        $moddate = get_the_modified_date();
        $modauthor = get_the_modified_author();
        
        $extra_content  = '<div class="entry-content-extra">';
        $extra_content .= '<p>Dernière modification le ' . $moddate . ' par ' . $modauthor . '.</p>';
        $extra_content .= '</div>';
        
        $content .= $extra_content;
    }

    return $content;
}

Filed Under: Genesis, Non classé

Créer un template avec une page

25 November 2014 par Stefano

J’ai pas mal galéré pour créer ma page qui est censé afficher tous les voyages.

Mon souci était que mon contenu, des articles, était englobé dans un <article>, après le <div class=”entry-content” …> et que par conséquent l’affichage était foireux.

Mon erreur était d’utiliser le mauvais “hook”.

// Append content to the standard page output
add_action( ‘genesis_entry_content’, ‘mon_contenu’ );

Le bon hook est celui-ci :

// Append content to the standard page output
add_action( ‘genesis_loop’, ‘summit_page_taxonomy_content’ );

Solution trouvée chez Carrie Dils :
http://www.carriedils.com/custom-page-template-genesis/

http://www.carriedils.com/genesis-2-0-archive-settings-custom-post-types/

Filed Under: Genesis, Non classé

Better taxonomy archive pages

22 November 2014 par Stefano

You’ll need the following plugins:

  1. Advanced Custom Fields (to create an image field for the new taxonomy)
  2. Code Snippets (to create the new taxonomy)

1) Add to function.php

Filed Under: Genesis, Non classé

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 4
  • Page 5
  • Page 6

Footer

Recent Posts

  • Jetpack Stats – il va falloir payer
  • Jetpack Personal : augmentation de prix
  • Générateurs de mots de passes
  • Générateur de GUID/UUID
  • Appareil photo du Samsung S22 Ultra

Categories

  • Apache
  • Cloudflare
  • DNS
  • Genesis
  • Infomaniak
  • Jetpack
  • Non classé
  • Outils
  • Photographie
  • Sécurité
  • Uncategorized
  • Wordpress
  • WP Rocket

Copyright © 2025 · Genesis Framework · WordPress · Log in