nrrghh
Forum Replies Created
-
hi
also spent time trying to figure this & solved
& if anyone has a more elegant solution to this basic problem do tell
inside image.php
then go to
function nggImage($gallery) {
add
$size = getimagesize($this->thumbURL); $this->tt_width = $size[0];
you then have a variable with a value to play off
<li class="<?php if ($image->tt_width > 150 ) {echo 'hthumb';} ?><?php if ($image->tt_width < 150 ) {echo 'vthumb';} ?>">
& thus can position & style landscape & portrait images
enjoy
Mark
Forum: Alpha/Beta/RC
In reply to: adding classes to tall and wide imageshi
have figured it
this by the way is so I can have a grid of floated li’s containing thumbnails & style based on image width
in the themes function.php (well if you are hacking out from Sandbox)
there is a chunk of code to style the Gallery
find
$img_src = wp_get_attachment_image_src( $id, $size );
you can then grab the width
$img_width = $img_src[1]; // added for for width test
which you need to do before
$img_src = $img_src[0];
then in the output code
if ( $img_width == 150 ) { $output .= ' class="wide" '; } // test for grid width styling
enjoy
m
Forum: Alpha/Beta/RC
In reply to: adding classes to tall and wide imageshi
https://codex.www.ads-software.com/Function_Reference/wp_get_attachment_image_src
indicates that can get at image width
not being any kind of php expert
how do I get at the width value
so I can then test and add a class
thanks in advance
m
Forum: Alpha/Beta/RC
In reply to: editing Gallery HTMLfigured it
first is global ‘media.php’ in main includes folder
then may also be stuff in themes functions.php file
enjoy
m
Forum: Plugins
In reply to: Page Navigation: checking for value of meta_keyhi
some progress
discovered get_post_custom_keys
code below gets the value of meta_key to then filter what Pages are shown in side nav
I imagine this could be done in a slightly more elegant manner…
<?php
$custom_field_keys = get_post_custom_keys();
foreach ( $custom_field_keys as $key => $value )
if ($key < 1 ) $var = $value;
wp_list_pages(“meta_key=$var&title_li=<h2>$var Pages</h2>” );
?>Mark