jschleuss
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: CSS Sprite Generator for ThumbnailsThat would work if I only had a few posts. But I’d have about 400 images and 400 sets of coordinates to input by hand. I don’t have time to do all that. I’d like to figure out a way to have it built in PHP and run whenever a new post is created.
In non-code terms this is what I’m trying to figure out:
when a new post is published run: loop through all posts if (post has thumbnail) { add post thumbnail to image sprite, copy coordinates inside sprite } end loop append css for sprite coordinates, clear css browser cacheAs an alternative, I’m also just trying to figure out how to speed up my page load time for the homepage and all image-populus pages. I currently average 4.25 seconds for the homepage to load.
Forum: Fixing WordPress
In reply to: Adding different styling every 3rd postThis is awesome, but I’m not sure how to implement a similar option using the
wp_nav_menutag. I’m not very familiar with PHP.This is what I have. I get a parse error if I use another <?php ?> inside for the class of the span. Any ideas on how to make it work for this template tag?
<?php $style_classes = array('first','second','third','fourth'); $style_index = 0; ?> <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'before' => '<span class="$k = $style_index%3; echo "class=$style_classes[$k]"; $style_index++;">', 'after' => '</span>' ) ); ?>