jampen26
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Display featured image as header on posts?No, that doesn’t work – your code above simply replaces the title with the featured image.
I would like the main page of the blog to display normally (with the title at the top), however, if someone click on the page for a paritcular post I would like the header in my twenty ten theme to display the featured image (with the title displaying as per normal.
thanks!
Forum: Fixing WordPress
In reply to: display thumbnails with category archive summaryamazing. sorry it has taken me so long to get on to this, but it has worked. thanks a million!
Forum: Fixing WordPress
In reply to: display thumbnails with category archive summaryHere it is. I place it directly after:
</div><!-- .entry-summary -->for display all alther posts.
And the full code
<?php /** * The loop that displays posts. * * The loop displays the posts and the post content. See * http://codex.wordpress.org/The_Loop to understand it and * http://codex.wordpress.org/Template_Tags to understand * the tags used in it. * * This can be overridden in child themes with loop.php or * loop-template.php, where 'template' is the loop context * requested by a template. For example, loop-index.php would * be used if it exists and we ask for the loop with: * <code>get_template_part( 'loop', 'index' );</code> * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ ?> <?php global $wp_query; query_posts( array_merge( $wp_query->query, array('posts_per_page' => 10) ) ); ?> <?php /* Display navigation to next/previous pages when applicable */ ?> <?php if ( $wp_query->max_num_pages > 1 ) : ?> <div id="nav-above" class="navigation"> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> </div><!-- #nav-above --> <?php endif; ?> <?php /* If there are no posts to display, such as an empty archive page */ ?> <?php if ( ! have_posts() ) : ?> <div id="post-0" class="post error404 not-found"> <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </div><!-- #post-0 --> <?php endif; ?> <?php /* Start the Loop. * * In Twenty Ten we use the same loop in multiple contexts. * It is broken into three main parts: when we're displaying * posts that are in the gallery category, when we're displaying * posts in the asides category, and finally all other posts. * * Additionally, we sometimes check for whether we are on an * archive page, a search page, etc., allowing for small differences * in the loop on each template without actually duplicating * the rest of the loop that is shared. * * Without further ado, the loop: */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* How to display posts of the Gallery format. The gallery category is the old way. */ ?> <?php if ( ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) || in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php twentyten_posted_on(); ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php if ( post_password_required() ) : ?> <?php the_content(); ?> <?php else : ?> <?php $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); if ( $images ) : $total_images = count( $images ); $image = array_shift( $images ); $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); ?> <div class="gallery-thumb"> <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a> </div><!-- .gallery-thumb --> <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ), 'href="' . get_permalink() . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"', number_format_i18n( $total_images ) ); ?></em></p> <?php endif; ?> <?php the_excerpt(); ?> <?php endif; ?> </div><!-- .entry-content --> <div class="entry-utility"> <?php if ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) : ?> <a href="<?php echo get_post_format_link( 'gallery' ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a> <span class="meta-sep">|</span> <?php elseif ( in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?> <a href="<?php echo get_term_link( _x( 'gallery', 'gallery category slug', 'twentyten' ), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a> <span class="meta-sep">|</span> <?php endif; ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> </div><!-- #post-## --> <?php /* How to display posts of the Aside format. The asides category is the old way. */ ?> <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <div class="entry-utility"> <?php twentyten_posted_on(); ?> <span class="meta-sep">|</span> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> </div><!-- #post-## --> <?php /* How to display all other posts. */ ?> <?php else : ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php twentyten_posted_on(); ?> </div><!-- .entry-meta --> <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php the_post_thumbnail(array( 200,200 ), array( 'class' => 'alignleft' )); ?> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <div class="entry-utility"> <?php if ( count( get_the_category() ) ) : ?> <span class="cat-links"> <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?> </span> <span class="meta-sep">|</span> <?php endif; ?> <?php $tags_list = get_the_tag_list( '', ', ' ); if ( $tags_list ): ?> <span class="tag-links"> <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> </span> <span class="meta-sep">|</span> <?php endif; ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> </div><!-- #post-## --> <?php comments_template( '', true ); ?> <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?> <?php endwhile; // End the loop. Whew. ?> <?php /* Display navigation to next/previous pages when applicable */ ?> <?php if ( $wp_query->max_num_pages > 1 ) : ?> <div id="nav-below" class="navigation"> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> </div><!-- #nav-below --> <?php endif; ?>cheers!
Forum: Fixing WordPress
In reply to: display thumbnails with category archive summaryHi all,
having lost all the changes to my site because I wan’t using a child theme (doh!) I am trying to backtrack and set up my excerpts to wrap around thumbnails of featured images on my categories pages.
I have inserted
<?php the_post_thumbnail(array( 200,200 ), array( 'class' => 'alignleft' )); ?>in my loop-category.php in my child theme (which is just a copy of the loop.php from twentyten that I renamed following advice form another forum)
The thumbnails are now displaying floated left, but are displaying below my social media buttons, rather than next to the text which should be wrapped around the image.
any ideas how I can rectify this? Link to page here
Forum: Themes and Templates
In reply to: Change fonts for navbar and drop down menuoh and my menu items are now also displaying in the wrong order.
The main reason I wanted to create a child theme is because my menu fonts reset themselves to default last week….but nothing else on my site changed…so I am kinda surprised (and ignorant) as to why I have lost nearly all of my original settings.
thanks in advance for your help!
Forum: Themes and Templates
In reply to: Change fonts for navbar and drop down menuI thought that by adding
@import url('../twentyten/style.css');the manual changes I had made to the original theme would be maintained (especially those that I had made in my WP dashboard?
I mean, the font settings I had made manually suddenly disappeared last week…but nothing else seemed to be affected and now nothing is working.
hmmmm….
Forum: Themes and Templates
In reply to: Change fonts for navbar and drop down menuOk so I have just activated my new child theme with the following code in the stylesheet:
body #access .menu-header li a { font-family: "Rock Salt", serif; }There has been no change to the font of the nav menu, my “explore” menu is no longer a drop down menu and the background image I was using has gone.
I seem to have lost the custom header I was using on the original theme (and I don’t think I have the file on my computer as I was burgled last year around the time I was making the original changes to my theme).
I tried looking in the twentyten directory to see if the header was saved there by I can’t see anything that looks like it.
I also seem to have lost all of the “likes” readers have given my previous two posts on the homepage.
oops?!?
Forum: Themes and Templates
In reply to: Change fonts for navbar and drop down menuThanks for the help guys!!
🙂 No…I was in the shower this morning and I realised I hadn’t yet activated the child theme. I currently don’t have a connection that is strong enough for me to do my editing…so I will have to try again this afternoon and let you know how it goes.
I suppose I should add the code that gidd lists above under the menu section of my child stylesheet? and can I add a command such as font-size: 20px within that?
Forum: Fixing WordPress
In reply to: display thumbnails with category archive summaryI think it must have been a cache issue.
It made no sense that the firebug info said one thing, and my stylesheet said another. Cache cleared…problem solved.
Thanks for the input, much appreciated!
Forum: Fixing WordPress
In reply to: display thumbnails with category archive summarySo re: my question about my drown down menu..
when i go to inspect element in my browser for each item in the drop down menu it shows the following:
menu-heading, ol, ul { font-size: 16px; font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; font-weight: bold;Yet when I go to the saved style.css in my wordpress dashboard it shows the following:
menu-heading,ol, ul { font-size: 16px; font-family: "Rock Salt", serif!important; font-weight: bold; font-color: #6a6bff;This confuses the hell out of me.
How can I override the default fonts of the theme for blockquotes and dropdown menus?
Forum: Themes and Templates
In reply to: customizing menu fontsWhen I “inspect element” it shows the following
menu-heading, ol, ul { font-size: 16px; font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; font-weight: bold;Yet when I go to the saved style.css it shows the following:
menu-heading,ol, ul { font-size: 16px; font-family: "Rock Salt", serif!important; font-weight: bold; font-color: #6a6bff;This confuses the hell out of me.
HELP!?!?!?!?
Forum: Themes and Templates
In reply to: customizing menu fontsWhen I “inspect element” it shows the following
menu-heading, ol, ul { font-size: 16px; font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; font-weight: bold;Yet when I go to the saved style.css it shows the following:
menu-heading,ol, ul { font-size: 16px; font-family: "Rock Salt", serif!important; font-weight: bold; font-color: #6a6bff;This confuses the hell out of me.
HELP!?!?!?!?
Forum: Themes and Templates
In reply to: customizing menu fontsthanks for your help.
I tried making this change and it hasn’t had any effect on the font of the links within the drop down menu.
Any other ideas?
Forum: Fixing WordPress
In reply to: display thumbnails with category archive summarybrilliant!! Thanks very much – posted it in my loop.php and looks a treat with a little fiddling with the width and float of the image.
I’m trying to change the font of the drop down menus too – any ideas or suggestions on how I might manage that?
I’d like the drown down menu to use the same font (Rock Salt) as the page title and the main menu titles.
Cheers
JForum: Fixing WordPress
In reply to: display thumbnails with category archive summaryOk, so here’s the page I am working on before I go ahead and rework all the featured images on the blog.
http://www.thehairychef.com/category/think
I’d like all featured images to have the excerpts wrapped around them (images floated to the left) but only on the category archive pages.
Cheers again!