Michael Fields
Forum Replies Created
-
Forum: Themes and Templates
In reply to: New page becomes big link to authors siteThere seems to be an unterminated anchor tag somewhere on the page. Please post a link to the page in question.
Forum: Themes and Templates
In reply to: Image thumbnailsOpps…
Forget that part.
This should pick the first image sorted by menu order:<?php $images = get_children( array( 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order' ) ); if ( $images ) { $count = 1; foreach ( $images as $id => $image ) { if( $count === 1 ) { $img = wp_get_attachment_thumb_url( $image->ID ); $link = get_permalink( $post->ID ); print "\n\n" . '<div><a href="' . $link . '"><img src="' . $img . '" alt="" /></div>'; } $count++; } } ?>Forum: Themes and Templates
In reply to: Theme images distorted or not showing after uploadIt looks like there was an issue when you uploaded the theme to your server – or when you unzipped it. Click on the following links:
http://johanneedwards.com/wp-content/themes/aeros/images/rss2.jpg
http://johanneedwards.com/wp-content/themes/aeros/images/lens.png
http://johanneedwards.com/wp-content/themes/aeros/images/default.jpgThese images in your theme’s images directory and appear to be the only images bundled with Aeros. I would first look in your local copy of the wordpress theme and see if the images are there, If so, upload them to the following directory on your live site: /wp-content/themes/aeros/images/.
If not, right click on the following links, save them to your computer (once open in a browser window – right click – save image as) and upload them to the directory I mentioned above..
favicon.ico
default.jpg
lens.png
rss2.jpgGood Luck!
-MikeForum: Themes and Templates
In reply to: Theme images distorted or not showing after uploadYou have an error in you theme’s functions.php file:
Parse error: syntax error, unexpected T_STRING in …/functions.php on line 1
Forum: Themes and Templates
In reply to: Image thumbnailsYou can do it by ‘hand’ too:
<?php $images = get_children( array( 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order' ) ); if ( $images ) { foreach ( $images as $id => $image ) { $img = wp_get_attachment_thumb_url( $image->ID ); $link = get_permalink( $post->ID ); print "\n\n" . '<div><a href="' . $link . '"><img src="' . $img . '" alt="" /></div>'; } } ?>Forum: Themes and Templates
In reply to: Custom Query Returns Nothing?I just visited the page. Have you tried the query directly below the query that you tried to use? It looks like it is set up to work with the “new” taxonomy tables.
Forum: Themes and Templates
In reply to: sidebar magically showing upWhich theme are you using? It is possible that get_sidebar() is being called in footer.php.
Forum: Themes and Templates
In reply to: Custom Query Returns Nothing?One things for sure… WordPress 2.6 does not have a ‘post2cat’ table. You must be reading an outdated codex page, can you provide a link to it?
Forum: Themes and Templates
In reply to: If page is a parentSteve,
Hi. I fudged around with this for a bit and got to the bottom of why the above examples are not working as expected. The latest versions of WordPress have introduced post revisions and this seems to be causing get_children() to return a “false” positive when there are no actual children pages. A page revision is stored in the database as a child page of the “actual” page with a post_type of “revision” and a post_status of “inherit”. I believe that the inherited post status is to blame here, but am not actually sure This being said, the following conditional code should print only when there are actual (non-revision) children”:<?php $mf_children = get_children( 'post_parent=' . $post->ID . '&post_type=page&post_status=publish' ); print '<pre>'; print_r( $mf_children ); print '</pre>'; print 'COUNT: ' . count( mf_children ); print ' - ' . $mf_children; print ' - ' . $post->ID; if( count( $mf_children ) > 0 ) { print '<div class="Menu" style="background:black;height:20px">'; print '<ul>'; $pages = wp_list_pages( 'sort_column=menu_order&title_li=&echo=0&child_of=' . $post->ID ); $pages = preg_replace( '%<a>]+)>%U', '</a><a><span>', $pages ); $pages = str_replace( '</a>', '</span>', $pages ); echo $pages; print '</ul>'; unset($pages); print '</div>'; } ?>However, this is not the case…
Sorry, I do not have a solution in this particular case – prior to 2.6, the above code should work…Forum: Themes and Templates
In reply to: If page is a parentThis works for me 2.6.2:
$children = get_children( "post_type=page" );Forum: Themes and Templates
In reply to: Unstyling custom fieldsTry this:
$myVar = get_post_meta( $post->ID, 'custom_fields_key', $single=true );Forum: Themes and Templates
In reply to: If page is a parent$children = get_children("post_parent=" . $post->ID ); if( $children ) // print menuForum: Themes and Templates
In reply to: Fully use template tags in Custom Page Templatesee my prior post -> use a loop!!
Forum: Themes and Templates
In reply to: Adding a themeYour theme NEEDS a style.css file for WordPress to recognize it as a theme. copy over the style.css from the default theme and modify the comments at the very top with your own information and you should be good to go.
Forum: Themes and Templates
In reply to: Fully use template tags in Custom Page TemplateAre you using a loop? You can use all of the tags you listed inside The Loop.