Forum Replies Created

Viewing 15 replies - 496 through 510 (of 1,041 total)
  • use this code in your loop:

    <?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 class="alignleft"><a href="' . $link . '"><img src="' . $img . '" alt="" /></a></div>';
    			}
    			$count++;
    		}
    	}
    ?>

    There is only one case in which I found that the above code will not work and that’s when you put a post in more than one category. Is this what is throwing you off? If so, I would strongly suggest only using one category per post – I know that this idea appears limiting to many bloggers, but I have found it to be a reliable way to “work with” WordPress’s built in functionality. If you need to further “categorize” your posts, I suggest that you use tags.

    I realize that this solution may not be for everyone, but I have been using WordPress for about 3.5 years and this is the only solution that has worked.

    Hope this helps,
    -Mike

    You should be able to use the following two functions in your single.php:

    if( in_category( 5 ) ) {
      next_post_link( $format='%link &raquo;', 'Next', true );
      previous_post_link( $format='&laquo; %link', 'Previous', true );
    }

    The post table comes with a pre-installed “menu_order” field. Why can’t you just use that?

    Opps…
    You need to embed the loop in this code, try this instead:

    <table>
    	<thead>
    		<th scope="col">Place to go</th>
    		<th scope="col">City</th>
    		<th scope="col">Kids age range</th>
    	</thead>
    		<tbody>
    		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<tr id="post-<?php the_ID(); ?>">
    			<td><a href="<?php the_permalink() ?>" rel="bookmark" title="Liens permanent vers <?php the_title_attribute(); ?>"><?php the_title(); ?></a></td>
    			<td><?php $values = get_post_custom_values("Lieu"); echo $values[0]; ?> pour les <?php $values = get_post_custom_values("min"); echo $values[0]; ?></td>
    			<td><?php $values = get_post_custom_values("max"); echo $values[0]; ?></td>
    		</tr>
    		<?php endwhile; endif; ?>
    	</tbody>
    </table>

    Try this in your loop:

    <table>
    	<thead>
    		<th scope="col">Place to go</th>
    		<th scope="col">City</th>
    		<th scope="col">Kids age range</th>
    	</thead>
    		<tbody>
    		<tr id="post-<?php the_ID(); ?>">
    			<td><a href="<?php the_permalink() ?>" rel="bookmark" title="Liens permanent vers <?php the_title_attribute(); ?>"><?php the_title(); ?></a></td>
    			<td><?php $values = get_post_custom_values("Lieu"); echo $values[0]; ?> pour les <?php $values = get_post_custom_values("min"); echo $values[0]; ?></td>
    			<td><?php $values = get_post_custom_values("max"); echo $values[0]; ?></td>
    		</tr>
    	</tbody>
    </table>

    Phill,

    “PEBCAK” – Problem Exists Between Chair and Keyboard!

    Never heard this before…. funny stuff!

    Glad everything is working for you!
    Mike

    1. Yes, but you will need to set up a development environment on your local machine. If you do not already have one, this is a simple, free, cross-platform solution: http://www.apachefriends.org/en/xampp.html

    Also, when you go to launch the site you will want to “Export” your data from the WordPress Administration Panels and then “Import” it onto your production server. DO NOT export/import the database alone.

    2. Perhaps, WordPress can handle this kind of a set up rather easily. But there will most definitely be a learning curve. Please note that said curve will be present in any dynamic system that you set up especially if you are not used to reading writing code (php). I assume that you are skilled in html css? If so, you should be alright… If you do most of your web production with a WYSIWYG, WordPress may not be the best solution for you.

    3. Drupal, Joomla are other popular solutions.

    4. Best of luck feel free to ask more questions!

    While I can agree with your frustration here, there is a very logical explanation for this… permalinks. If you did not have permalinks turned on, relative urls would work just fine everywhere a post can be displayed.

    On my blog, I use the “Day and name” based permalinks.

    This means that a post can be displayed at anyone of the following urls:

    http://example.com/
    http://example.com/2009/06/13/sample-post/
    http://example.com/category/tacos/
    http://example.com/tags/tacos/

    There is no relative path that satisfies all of these combination.

    Hope this helps!

    I would read up on this: http://codex.ww.wp.xz.cn/Weblog_Client

    I develop themes and plugins on a local machine where the and eventually upload the code to the live server. This means that I always need to get new content from the live site before I start… I use the import/export functionality that can be found under “Tools” in your Administration Panels. Although this works rather well most of the time – I do experience double posting and sometimes revisions get turned into drafts. I would not suggest this as a daily procedure.

    Please see this link: http://codex.ww.wp.xz.cn/Weblog_Client

    #5 under “Advantages” states “Features like cross-posting to multiple blogs”

    I would suggest against this procedure all together. The wp_options table is home to a TON of serialized data which is very messy to edit by hand. This table also holds information pertaining to your uploads – have of which is serialized…

    how many records do you have in there? Are there any pressing issues that make you want to “clean” the table.

    Also, where is the best palce to get a frsh table? SHould I just create a new install on another domain I have and copy that across, then edit via phpmyadmin the basic elements?

    This sounds like it will work – if you want to try this, just head my warning – if you kill all of the options – you will at least have to re-upload all of your images. And some of your plugins might go buggy.

    Hope this helps 🙂

    BTW – love that feedback app on your site… what is it?

    Please try posting to this email list:
    http://lists.automattic.com/mailman/listinfo/wp-pro

    Ok… Let’s start with your Settings. on the left hand sidebar in The Administration Panels – click on “Settings” -> “Media”. This section allows you to control what size WordPress will make your “smaller” images when you upload them. NOTE: WordPress will not create these auxiliary images if the original image that you upload is smaller than any of these sizes.

    In the default settings, you will see that the “Large size” is set to 1024. Unless you upload an image larger than this, you will never have a “Large size” image.

    Once you have your settings set the way you want you can create a new post – to upload the images, click on the little rectangle to the right of the words “Upload/Insert” – this is located directly under the title of your post.

    This will bring up a “thickbox” dialog with three tabs along the top, the first tab will give you a button to select files from your computer to upload. do this and when all are uploaded, click on the “Gallery” tab. Here you will be able to click on “show” for any image and there are many options to send an individual image to the post box on the “Edit Post” screen. You also have the option to send all images to the post box using the gallery shortcode.

    Hope this gives you some kinda insight into this!

Viewing 15 replies - 496 through 510 (of 1,041 total)