Toutes mes réponses sur les forums
-
AuteurMessages
-
‘Primary Navigation’,
)
);
// Add support for Post Formats
add_theme_support( ‘post-formats’, array( ‘image’, ‘gallery’, ‘video’, ‘audio’, ‘aside’, ‘link’ ) );
// Add support for post formats and custom image sizes specific to theme locations
add_theme_support( ‘post-thumbnails’, array( ‘post’ ) );
add_image_size( ‘slider-thumb’, 600, 400, 1 );
add_image_size( ‘homepage-thumb’, 688, 230, 1 );
add_image_size( ‘gallery-thumb’, 200, 200, 1 );
add_image_size( ‘video-thumb’, 700, 444, 1 );
add_image_size( ‘single-thumb’, 460, 348 );
add_image_size( ‘attachment-thumb’, 688, 9999 ); // no crop flag, unlimited height
// Allows users to set a custom background
add_custom_background();
// Allows users to set a custom header image
if ( ! defined( ‘HEADER_TEXTCOLOR’ ) )
define( ‘HEADER_TEXTCOLOR’, ‘151515’ );
// The height and width of your custom header.
if ( ! defined( ‘HEADER_IMAGE_WIDTH’ ) )
define( ‘HEADER_IMAGE_WIDTH’, 940 );
if ( ! defined( ‘HEADER_IMAGE_HEIGHT’ ) )
define( ‘HEADER_IMAGE_HEIGHT’, 100 );
// Add a way for the custom header to be styled in the admin panel
add_custom_image_header( ‘minimatica_header_style’, ‘minimatica_admin_header_style’ );
// Styles the post editor
add_editor_style();
// Makes theme translation ready
load_theme_textdomain( ‘minimatica’, get_template_directory() . ‘/languages’ );
$locale = get_locale();
$locale_file = get_template_directory() . « /languages/$locale.php »;
if ( is_readable( $locale_file ) )
require_once( $locale_file );
}
endif;
add_action( ‘after_setup_theme’, ‘minimatica_theme_setup’ );
if ( ! function_exists( ‘minimatica_widgets_init’ ) ) :
/**
* Registers theme widget areas
*
* @uses register_sidebar()
*
* @since Minimatica 1.0
*/
function minimatica_widgets_init() {
register_sidebar(
array(
‘name’ => ‘Sidebar’,
‘before_widget’ => ‘<aside id="%1$s" class="widget %2$s">‘,
‘after_widget’ => ‘</aside><!-- .widget -->‘,
‘before_title’ => ‘<h3 class="widget-title">‘,
‘after_title’ => ‘</h3>‘
)
);
register_sidebar(
array(
‘name’ => ‘Footer’,
‘before_widget’ => ‘<aside id="%1$s" class="widget %2$s">‘,
‘after_widget’ => ‘</aside><!-- .widget -->‘,
‘before_title’ => ‘<h3 class="widget-title">‘,
‘after_title’ => ‘</h3>‘
)
);
}
endif;
add_action( ‘widgets_init’, ‘minimatica_widgets_init’ );
if ( ! function_exists( ‘minimatica_paged_posts’ ) ) :
/**
* Overrides the default posts_per_page value when viewing in gallery mode
* This prevents the 404 flag from being triggered when using query_posts() with pagination
* It does not alter the database value for the option, only fiters it when the posts query is called
*
* @since Minimatica 1.0
*/
function minimatica_paged_posts( $query ) {
if( (
( $query->is_home() && ‘gallery’ == minimatica_get_option( ‘homepage_view’ ) ) ||
( $query->is_category() && ‘gallery’ == minimatica_get_option( ‘category_view’ ) ) ||
( $query->is_tag() && ‘gallery’ == minimatica_get_option( ‘tag_view’ ) ) ||
( $query->is_author() && ‘gallery’ == minimatica_get_option( ‘author_view’ ) ) ||
( $query->is_archive() && ‘gallery’ == minimatica_get_option( ‘archive_view’ ) )
) && ( ! is_single() )
)
$query->set( ‘posts_per_page’, ‘4’ );
}
endif;
add_filter( ‘pre_get_posts’, ‘minimatica_paged_posts’ );
/**
* Return default array of options
*
* @since Minimatica 1.0
*/
function minimatica_default_options() {
$options = array(
‘homepage_view’ => ‘gallery’,
‘category_view’ => ‘gallery’,
‘tag_view’ => ‘blog’,
‘author_view’ => ‘blog’,
‘archive_view’ => ‘blog’,
‘blog_category’ => 0
);
return $options;
}
if ( ! function_exists( ‘minimatica_get_option’ ) ) :
/**
* Used to output theme options is an elegant way
*
* @uses get_option() To retrieve the options array
*
* @since Minimatica 1.0
*/
function minimatica_get_option( $option ) {
$options = get_option( ‘minimatica_options’, minimatica_default_options() );
return $options[ $option ];
}
endif;
if ( ! function_exists( ‘minimatica_doc_title’ ) ) :
/**
* Output the <title> tag
*
* @since Minimatica 1.0
*/
function minimatica_doc_title() {
global $page, $paged;
$doc_title = »;
$site_description = get_bloginfo( ‘description’, ‘display’ );
$separator = ‘#124’;
if ( !is_front_page() ) :
$doc_title .= wp_title( », false);
if ( $paged >= 2 || $page >= 2 )
$doc_title .= ‘, ‘ . __( ‘Page’ ) . ‘ ‘ . max( $paged, $page );
if ( is_archive() )
$doc_title .= ‘ &’ . $separator . ‘; ‘;
elseif ( is_singular() )
$doc_title .= ‘ &’ . $separator . ‘; ‘;
endif;
if ( is_archive() )
$doc_title .= get_bloginfo( ‘name’ );
elseif ( is_singular() )
$doc_title .= get_bloginfo( ‘name’ );
elseif ( is_front_page() )
$doc_title .= get_bloginfo( ‘name’ );
if ( is_front_page() && ( $paged >= 2 || $page >= 2 ) )
$doc_title .= ‘, ‘ . __( ‘Page’ ) . ‘ ‘ . max( $paged, $page );
if ( $site_description && ( is_home() || is_front_page() ) )
$doc_title .= ‘ &’ . $separator . ‘; ‘ . $site_description;
echo $doc_title;
}
endif;
if ( ! function_exists( ‘minimatica_register_styles’ ) ) :
/**
* Register theme styles
*
* @uses wp_register_style() To register styles
*
* @since Minimatica 1.0.1
*/
function minimatica_register_styles() {
wp_register_style( ‘minimatica’, get_bloginfo( ‘stylesheet_url’ ), false, ‘1.0.1’ );
wp_register_style( ‘colorbox’, get_template_directory_uri() . ‘/styles/colorbox.css’, false, ‘0.5’ );
wp_register_style( ‘minimatica-ie’, get_template_directory_uri() . ‘/styles/ie.css’, false, ‘1.0’ );
}
endif;
add_action(‘init’, ‘minimatica_register_styles’);
if ( ! function_exists( ‘minimatica_enqueue_styles’ ) ) :
/**
* Enqueue theme styles
*
* @uses wp_enqueue_style() To enqueue styles
*
* @since Minimatica 1.0
*/
function minimatica_enqueue_styles() {
wp_enqueue_style( ‘minimatica’ );
if( is_single() )
wp_enqueue_style( ‘colorbox’ );
wp_enqueue_style( ‘minimatica-ie’ );
// Add IE conditionals
global $wp_styles;
$wp_styles->add_data( ‘minimatica-ie’, ‘conditional’, ‘lte IE 8’ );
}
endif;
add_action(‘wp_print_styles’, ‘minimatica_enqueue_styles’);
if ( ! function_exists( ‘minimatica_register_scripts’ ) ) :
/**
* Register theme scripts
*
* @uses wp_register_scripts() To register scripts
*
* @since Minimatica 1.0.1
*/
function minimatica_register_scripts() {
// Add HTML5 support to older versions of IE
wp_register_script( ‘html5’, get_template_directory_uri() . ‘/scripts/html5.js’, false, ‘1.5.1’ );
wp_register_script( ‘audio-player’, get_template_directory_uri() . ‘/scripts/audio-player.js’, array( ‘swfobject’ ), ‘2.2’ );
wp_register_script( ‘kwicks’, get_template_directory_uri() . ‘/scripts/kwicks.js’, array( ‘jquery’ ), ‘1.5.1’ );
wp_register_script( ‘colorbox’, get_template_directory_uri() . ‘/scripts/colorbox.js’, array( ‘jquery’ ), ‘1.3.16’ );
wp_register_script( ‘minimatica’, get_template_directory_uri() . ‘/scripts/minimatica.js’, array( ‘kwicks’ ), ‘1.0’ );
}
endif;
add_action( ‘init’, ‘minimatica_register_scripts’ );
if ( ! function_exists( ‘minimatica_enqueue_scripts’ ) ) :
/**
* Enqueue theme scripts
*
* @uses wp_enqueue_scripts() To enqueue scripts
*
* @since Minimatica 1.0
*/
function minimatica_enqueue_scripts() {
// Add HTML5 support to older versions of IE
if( isset( $_SERVER[‘HTTP_USER_AGENT’] ) &&
( false !== strpos( $_SERVER[‘HTTP_USER_AGENT’], ‘MSIE’ ) ) &&
( false === strpos( $_SERVER[‘HTTP_USER_AGENT’], ‘MSIE 9’ ) ) )
wp_enqueue_script( ‘html5’ );
wp_enqueue_script( ‘kwicks’ );
if ( is_singular() && get_option( ‘thread_comments’ ) )
wp_enqueue_script( ‘comment-reply’ );
if ( is_single() && has_post_format( ‘video’ ) )
wp_enqueue_script( ‘swfobject’ );
if ( is_single() && has_post_format( ‘audio’ ) )
wp_enqueue_script( ‘audio-player’ );
if ( is_single() )
wp_enqueue_script( ‘colorbox’ );
wp_enqueue_script( ‘minimatica’ );
}
endif;
add_action( ‘wp_enqueue_scripts’, ‘minimatica_enqueue_scripts’ );
if ( ! function_exists( ‘minimatica_call_scripts’ ) ) :
/**
* Call script functions in document head
*
* @since Minimatica 1.0
*/
function minimatica_call_scripts() { ?>
/* <![CDATA[ */
jQuery().ready(function() {
jQuery('#nav-slider a').live('click', function(e){
e.preventDefault();
var link = jQuery(this).attr('href');
jQuery('#slider').html('<img src="/images/loader.gif » style= »display:block; margin:173px auto » />’);
jQuery(‘#slider’).load(link+’ #ajax-content’, function(){
slide();
});
});
jQuery(‘a.colorbox’).colorbox({
maxWidth:900,
maxHeight:600
});
});
AudioPlayer.setup(« /audio-player/player.swf », {
width: 290
});
/* ]]> */
Header admin panel.
*
* @since Minimatica 1.0.7
*/
function minimatica_header_style() {
if( » != get_header_image() ) : ?>
#site-title {
width:px;
height:px;
background-image:url();
}
#site-title a {
display:none;
color:#;
}
#headimg {
background-image:url();
}
#headimg h1 a {
color:#;
font-weight:normal;
line-height:60px;
text-decoration:none;
}
#headimg #desc {
display:none;
}
<div id="primary-nav" class="nav">
<ul>
<li>
<a href=" » rel= »home »></a>
</li>
<li>
<a href="http://www.maximedacosta.fr/?page_id=464"></a>
</li>
<li>
<a href="http://www.maximedacosta.fr/?page_id=466"></a>
</li>
<li>
<a href="http://www.maximedacosta.fr/?p=627"></a>
</li>
<li>
<a href="http://www.maximedacosta.fr/?page_id=461"></a>
</li>
<!– –>
</ul>
</div><!-- #primary-nav -->
<a class="colorbox" href=" » title= » » rel= »attachment »>
</a>
1,
‘post_type’ => ‘attachment’,
‘post_mime_type’ => ‘image’,
‘post_parent’ => get_the_ID()
);
$attachments = get_posts( $args );
if( count( $attachments ) )
$attachment = $attachments[0];
if( isset( $attachment ) && ! post_password_required() ) : ?>
<figure class="entry-attachment">
<a class="colorbox" href="ID, ‘full’ ); echo $image[0]; ?> » title= » » rel= »attachment »>
ID, ‘attachment-thumb’ ); ?>
</a>
post_excerpt ) ) : ?>
<figcaption class="entry-caption">
post_excerpt ); ?>
</figcaption><!-- .entry-caption -->
</figure><!-- .entry-attachment -->
-1,
‘post_type’ => ‘attachment’,
‘post_mime_type’ => ‘image’,
‘post_parent’ => get_the_ID()
);
$attachments = get_posts( $args );
// Reverse array to display them in chronological form instead of reverse chronological
//La ligne ci-dessous inverse l’ordre d’apparition des images à une page jointe.
// $attachments = array_reverse( $attachments );
if( count( $attachments ) && ! post_password_required() ) : ?>
<div class="gallery post-gallery gallery-columns-3">
<div class="gallery-row">
<figure class='gallery-item'>
<a class="colorbox" href="ID, ‘full’ ); echo $image[0]; ?> » title= »ID ) ); ?> » rel= »attachment »>
ID, ‘gallery-thumb’ ); ?>
</a>
post_excerpt ) ) : ?>
<figcaption class='wp-caption-text gallery-caption'>
post_excerpt ); ?>
</figcaption><!-- .gallery-caption -->
</figure><!-- .gallery-item -->
<div class="clear"></div>
</div><!-- .gallery-row -->
<div class="gallery-row">
<div class="clear"></div>
</div><!-- .gallery-row -->
</div><!-- .post-gallery -->
<?php endif;
}
endif;
if ( ! function_exists( 'minimatica_post_video' ) ) :
/**
* Video playback support for post with the video format
*
* Displays the attached video in a HTML5 <video> tag with flash fallback
* If more then one attached video is found, they are used as fallback to the first one
* Should work in most if not all browsers :)
*
* @uses get_posts() To retrieve attached videos
*
* @since Minimatica 1.0
*/
function minimatica_post_video() {
// Get attached videos
$args = array(
‘numberposts’ => -1,
‘post_type’ => ‘attachment’,
‘post_mime_type’ => ‘video’,
‘post_parent’ => get_the_ID()
);
$attachments = get_posts( $args );
// Reverse array to display them in chronological form instead of reverse chronological
$attachments = array_reverse( $attachments );
if( count( $attachments ) ) :
// Detect flash video format to use it as fallback
$mime_types = array();
foreach( $attachments as $attachment ) :
if( $attachment->post_mime_type == ‘video/x-flv’ )
$flash_video = $attachment;
endforeach;
endif;
if( count( $attachments ) && ! post_password_required() ) : ?>
<div class="entry-attachment">
<video controls width="700" height="444" poster=" » id= »video-player »>
<source src="ID ); ?> » type=’post_mime_type; if( $attachment->post_mime_type == ‘video/mp4’ ) echo ‘; codecs= »avc1.42E01E, mp4a.40.2″‘; elseif( $attachment->post_mime_type == ‘video/webm’ ) echo ‘; codecs= »vp8, vorbis »‘; elseif( $attachment->post_mime_type == ‘video/ogg’ ) echo ‘; codecs= »theora, vorbis »‘; ?>’>
</video>
<div id="player"></div>
/* <![CDATA[ */
var videoTag = document.createElement('video');
if( !( !!( videoTag.canPlayType ) && ( ( ( « no » != videoTag.canPlayType( « post_mime_type; ?> » ) ) && ( « » != videoTag.canPlayType( « post_mime_type; ?> » ) ) ) || ) ) ) {
document.getElementById(« video-player »).style.display= »none »;
var flashvars = {
skin: « /video-player/skin.swf »,
video: « ID ); ?> »,
thumbnail: « »
};
var params = {
quality: « high »,
menu: « false »,
allowFullScreen: « true »,
scale: « noscale »,
allowScriptAccess: « always »,
swLiveConnect: « true »
};
var attributes = {
id: « f4-player »
};
swfobject.embedSWF(« /video-player/player.swf », « player », « 700 », « 444 », « 9.0.0 », »expressInstall.swf », flashvars, params, attributes);
} else {
document.getElementById(« player »).style.display= »none »;
}
/* ]]> */
</div><!-- .entry-attachment -->
<?php endif;
}
endif;
if ( ! function_exists( 'minimatica_post_audio' ) ) :
/**
* Audio playback support for post with the audio format
*
* Displays the attached audio files in a HTML5 <audio> tag with flash fallback
* If more then one attached audio file is found, they are used as fallback to the first one
* Should work in most if not all browsers :)
*
* @uses get_posts() To retrieve attached audio files
*
* @since Minimatica 1.0
*/
function minimatica_post_audio() {
// Get attached audio files
$args = array(
‘numberposts’ => -1,
‘post_type’ => ‘attachment’,
‘post_mime_type’ => ‘audio’,
‘post_parent’ => get_the_ID()
);
$attachments = get_posts( $args );
// Reverse array to display them in chronological form instead of reverse chronological
$attachments = array_reverse( $attachments );
if( count( $attachments ) ) :
// Detect MP3 file to use it as flash fallback
$mime_types = array();
foreach( $attachments as $attachment ) :
if( $attachment->post_mime_type == ‘audio/mpeg’ )
$flash_audio = $attachment;
endforeach;
endif;
if( count( $attachments ) && ! post_password_required() ) : ?>
<div class="entry-attachment">
<audio controls id="player">
<source src="ID ); ?> »>
</audio>
<div id="audioplayer"></div>
var audioTag = document.createElement(‘audio’);
if( !( !!( audioTag.canPlayType ) && ( ( ( « no » != audioTag.canPlayType( « post_mime_type; ?> » ) ) && ( « » != audioTag.canPlayType( « post_mime_type; ?> » ) ) ) || ) ) ) {
document.getElementById(« player »).style.display= »none »;
AudioPlayer.embed(« audioplayer », {soundFile: « ID ); ?> »});
}
</div><!-- .entry-attachment -->
comment_type ) :
case » :
?>
<li id= »li-comment-« >
<article id="comment- » class= »comment-body »>
<header class="comment-header">
<div class="comment-author vcard">
<?php printf( __( '%s <span class="says">says:</span>‘, ‘minimatica’ ), sprintf( ‘<cite class="fn">%s</cite>‘, get_comment_author_link() ) ); ?>
</div><!-- .comment-author .vcard -->
comment_approved == ‘0’ ) : ?>
<em class="comment-awaiting-moderation"></em>
<br />
<div class="comment-meta commentmetadata"><a href="comment_ID ) ); ?> »>
</a>
</div><!-- .comment-meta .commentmetadata -->
</header><!-- .comment-header -->
<div class="comment-content"></div>
<footer class="comment-footer">
<div class="reply">
$depth, ‘max_depth’ => $args[‘max_depth’] ) ) ); ?>
</div><!-- .reply -->
</footer><!-- .comment-footer -->
</article><!-- #comment-## -->
<li class="pingback">
<p> </p>
<?php
break;
endswitch;
}
endif;En copie/collant le code j’ai trouvé ^^’ il suffit de virer l’initialisation de &attachment à un tableau inversé
Si si.
La partie de code à modifier pour changer l’ordre :
$attachments = array_reverse( $attachments );
if( count( $attachments ) && ! post_password_required() ) : ?><?php $counter++;
// Show gallery in 3 rows ?>
<?php if( !( $counter % 3 ) && ( $attachment != end( $attachments ) ) ) :
// If 3 images have been shown, end the image row and open a new one ?>
<?php endif;Le problème c’est que je vois pas bien quoi modifier. Les images jointes sont prise par ordre d’ID. Comment je peux faire pour inverser cette ordre ?
Parce que j’ai changé pas mal de chose, j’ai ajouté des functions j’en ai modifié et supprimé certaines.
La version 1.0.8. J’ai deja essayé de modifier function.php mais s’en arriver à résoudre mon problème.
15 novembre 2013 à 17 h 58 min en réponse à : Thème minimatica : problème d’affichage d’image dans la galerie #814124La version 1.0.8. J’ai deja essayé de modifier function.php mais s’en arriver à résoudre mon problème.
15 novembre 2013 à 14 h 03 min en réponse à : Thème minimatica : problème d’affichage d’image dans la galerie #814123Bonjour,
le sujet date un peu mais comme vous etes des utilisateurs de minimatica peut etre pourrez vous m’aider.
J’ai un problème d’ordre d’affichage avec mes images. J’ai attaché plusieurs images à un article. Celles-ci s’affichent sans problème dans l’article cependant je ne peux pas en changer l’ordre, je suppose qu’il dépend de la date d’upload de l’image. Impossible de changer cette date (à moins de supprimer la photo pour la ré-up).
Y’a-t’il une solution ?
Merci
C’est ça, mes images sont dans ma bibliothèque. Et j’ai juste à les « joindre » à l’article pour qu’elles s’affichent dedans.
Oula oui, autant pour moi. Ca fait 3 ans que j’ai pris un hébergement chez eux, les offres n’étaient pas les mêmes et ne portaient pas les mêmes noms.
L’offre « Essentiel » est suffisante pour un site perso qui sert principalement de vitrine.
J’avais la première offre classique avec 2,5go d’espace de stockage. Mais ils ont mis a jour leur tarif et pour le meme prix j’ai maintenant l’offre « Essentiel » avec 10go d’espace de stockage.
Problem solve.
En fait ça venait de mon hébergeur. Mon quota était atteint.
Je voyais bien 500mo d’espace libre mais c’est en fait 500mo de dédiés à divers script (je ne sais pas lequels) j’étais donc limité à 2go et non 2,5go comme je le pensais (il n’est pas fait mention de ces 500Mo inutilisable lors de l’achat -_-‘)Merci bien et bonne journée,
Maxidac
Très bien merci, je vais tester ça.
Bonsoir,
Les images up sont en effet assez grande (bien que 5 fois plus petites que les originales) mais elle sont réduit à l’affichage.
Ce que je ne comprends pas c’est pourquoi certaines image peuvent etre up sans problèmes alors que d’autres, exactement similaire en poids, taille et format ne le peuvent pas.COmme plugin j’ai :
– Contact Form Plugin
– Easy Table Creator
– Global Translator
– Image Widget
– Light box Plus
– Meteor Slide
– Widget LogicMerci beaucoup tout fonctionne très bien. Effectivement le .htaccess n’était pas dans les deux répertoire et le zip était mal extrait.
Merci pour votre rapidité, bonne journée,
Maxidac
Merci, le .htaccess était apparemment mal placé.
J’ai cependant toujours le même problème. Je ne vois pas comment y remédier.
-
AuteurMessages