Horisontal og vertikal centrering

WordPress plugin: NextGen gallery style (css) fra linje 116

.ngg-galleryoverview { overflow: hidden; padding: 4px; width: 100%; border-top: 2px solid #bfdbe2; clear: both; display: block !important;}
.ngg-gallery-thumbnail-box { float: left; width: 124px; height: 124px; margin: 5px;}
.ngg-gallery-thumbnail { width: 124px; height: 124px; display: table-cell; vertical-align: middle; border: 2px solid #cdcdcd; background-color: #efefef;}
a:hover .ngg-gallery-thumbnail { border: 2px solid #dedede; background-color: #ababab;}
.ngg-gallery-thumbnail img { display: block; margin-left: auto; margin-right: auto; padding: 2px; position: relative;}
.ngg-clear { clear: both;}

gallery.php

<!-- Thumbnails --> <?php foreach ( $images as $image ) : ?> <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> > <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> > <div class="ngg-gallery-thumbnail" > <?php if ( !$image->hidden ) { ?> <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> /> <?php } ?> </div> </a> </div>

Vis “Indlæggests thumbnail”/”Featured Image”

Åben loop.php og tilføj:

<?php
 //This must be in one loop
 if(has_post_thumbnail()) {
 the_post_thumbnail();
 } else {
 echo '<img src="'.get_bloginfo("template_url").'/images/img-default.png" />';
 }
 ?>

Tilføj det i linje 131, hvis du vil have dit billede til at være lige før uddrag/excerpts i din post.

<?php the_post_thumbnail( array(300,300) ); ?>

Resource: http://codex.wordpress.org/Function_Reference/the_post_thumbnail

Første post skal se anderledes ud

I WordPress ser alle post ens ud. Men du kan med få midler, få den første post til at se anderledes ud en alle de andre.

Manualen er til WordPress version 3.x

    1. Åben loop.php og find:
 <?php while ( have_posts() ) : the_post(); ?>
    1. Lav et linjeskift og indsæt:
<?php $firstClass = 'firstpost'; ?>
  1. Find:
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  2. Indsæt:
    <?php echo $firstClass; ?>...så det nu ser sådan her ud:
     <div id="post-<?php the_ID(); ?> <?php echo $firstClass; ?>" <?php post_class(); ?>>
  3. Indsæt en ny linje lige bag efter, og tilføj:
    <?php $firstClass = ""; ?>
  4. Tilføj i dit stylesheet (style.css), og ret det til med attributer:
    #firstpost

Tak til Adam R Brown for php koderne

Album rækkefølge efter titel

Linie 324 (lib/ngg-db.php).

Ændre fra:

$album->sortorder  =  serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery") );

til:

$album->sortorder  =  serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery ORDER BY name ASC") );

Husk at albums nu sorteres efter alfanumerisk i feltet titel.