Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • To those who call, “It’s not wordpress” – what server issues are they, that so neatly coincide for so many, to the change of WP versions. My server (Hostpapa) tells me there is no issue (I don’t believe them.)

    I don’t care where the problems lie; we can’t go on for weeks without solutions.
    Thanks all, for all your efforts.

    It’s all about the theme,If you read the codex about theme development, you will gain the skills to edit your themes, such that they do what you want. I think the best way to display different posts is to differentiate by categories – also explained in the codex.
    Start here:
    Codex: Using Themes!

    Thread Starter Andrewcb

    (@andrewcb)

    Hello,

    So in my while loop, there are some cat=32 posts, and other.

    I want my code to go through and post:
    Winter 09
    Photos in Winter 09
    Text Posts in Winter 09
    Autumn 08
    Photos in Autumn 08
    Text Posts in Autumn 08

    But in order to collect and post all the photos, the loop has already gone past some text posts, and I don’t know how to get it to go back and look again.
    I thought Current_Post could do it, but when I print it, it appears to have no value.

    So i guess the questoin is, how do I get the loop to output the above sequence, assuming the photo posts are category 32, and any other category post can go in the text posts?
    Thanks for you help

    Thread Starter Andrewcb

    (@andrewcb)

    I have a bigger problem than that, I now have to try and re-code that so it gives:
    Season Title,
    Photos
    Posts
    Season Title
    Photos Posts

    Rather than
    Season title
    photos
    Season Title Photos

    Then all the posts at the end.

    I have just made some progess thinking that out, and I think I will be able to code it tonight! ??

    Thread Starter Andrewcb

    (@andrewcb)

    Ihave this so far:

    <div id="MajorContent">
    <h2> Photography! </h2>
    
    <?php
    
    $year = date('y');
    $month = date('m');
    $day = date('d');
    
     if (have_posts()) :
    
    if (($month == 12 && $day >=21) || ($month < 03) || ($month == 3 && $day < 21 )){
    echo '<div id="post"><h2>Winter'; echo " $PostYear"; echo "</h2></div>";
    $Season = 1;}
    if (($month == 3 && $day >=21) || ($month == 04) || ($month == 05) || ($month == 6 && $day < 21 )){
    echo '<div id="post"><h2>Spring'; echo " $PostYear"; echo "</h2></div>";
    $Season = 2;}
    if (($month == 6 && $day >=21) || ($month == 07) || ($month == 08) || ($month == 9 && $day < 21 )){
    echo '<div id="post"><h2>Summer'; echo " $PostYear"; echo "</h2></div>";
    $Season = 3;}
    if (($month == 9 && $day >=21) || ($month == 10) || ($month == 11) || ($month == 12 && $day < 21 )){
    echo '<div id="post"><h2>Autumn'; echo " $PostYear"; echo "</h2></div>";
    $Season = 4;}
    //echo "$Season";
    
    		 while (have_posts()) : the_post();
    
    			 if (in_category('32')) {
    		$PostYear = get_the_time('y');
    		$PostMonth = get_the_time('m');
    		$PostDay = get_the_time('d');
    
    		if (($PostMonth == 12 && $PostDay >=21) || ($PostMonth < 03) || ($PostMonth == 3 && $PostDay < 21 )){
    			$PostSeason = 1;} //Winter
    		if (($PostMonth == 3 && $PostDay >=21) || ($PostMonth == 04) || ($PostMonth == 05) || ($PostMonth == 6 && $PostDay < 21 )){
    			$PostSeason = 2;} //Spring
    		if (($PostMonth == 6 && $PostDay >=21) || ($PostMonth == 07) || ($PostMonth == 08) || ($PostMonth == 9 && $PostDay < 21 )){
    			$PostSeason = 3;}  //Summer
    		if (($PostMonth == 9 && $PostDay >=21) || ($PostMonth == 10) || ($PostMonth == 11) || ($PostMonth == 12 && $PostDay < 21 )){
    			$PostSeason = 4;}  //Autumn
    //echo "Before the If loop Season is $Season and PostSeason is $PostSeason </br>";
    if ($Season == $PostSeason) {
    ;}
    	elseif ($PostSeason == 1){
    echo '<div id="postTitle"><h2>Winter'; echo " $PostYear"; echo "</h2></div>";
    	$Season = 1;}
    	elseif ($PostSeason == 2){
    echo '<div id="postTitle"><h2>Spring'; echo " $PostYear"; echo "</h2></div>";
    	$Season = 2; }
    	elseif ($PostSeason == 3){
    echo '<div id="postTitle"><h2>Summer'; echo " $PostYear"; echo "</h2></div>";
    	$Season = 3; }
    	elseif ($PostSeason == 4){
    echo '<div id="postTitle"><h2>Autumn'; echo " $PostYear"; echo "</h2></div>";
    	$Season = 4; }
    	else {
    	//echo '<h1>Probably Winter, Maybe Summer</>';
    	$Season = 4; }
    //echo "After the If loop Season is $Season and PostSeason is $PostSeason </br></br>";
    
    ?>
    
    				<div class="postThumb" id="post-<?php the_ID(); ?>">
    						<?php the_excerpt() ?>
    				</div>
    		<?php };
    		endwhile; ?>
    <div id="post">
    <h2> Ideas! </h2>
    </div>
    		  <?php rewind_posts(); ?>  // Rewinds to beginning of query.
    
      	<?php while (have_posts()) : the_post(); ?>
    	   <?php if ( ! in_category('32')) { ?>
    				<div class="post" id="post-<?php the_ID(); ?>">
    						<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <br />
    						<?php the_content() ?> <br /><br />
    				</div>
    		<?php };
      		endwhile ;
    
    endif ; ?>
    
    </div>

    I know there must be better methods.
    but if anyone knows how i can get the photos and the text ideas to work such that they show alternatly as the above post suggests, within each season, let me know.

    Thread Starter Andrewcb

    (@andrewcb)

    Anyone help with the code to do this in the index.php,

    $date = current_date
    &year = current_year

    While (have poast) <– notmal loop begining <
    if $date < 21/03/$year < $post_date
    { <p Spring .$year p>}
    if $date < 21/06/$year < $post_date
    { <p summer .$year p>}
    if $date < 21/09/$year < $post_date
    { <p Spring .$year p>}
    if $date < 21/12/$year < $post_date
    { <p Spring .$year p>}

    Do the normal thing i.e. post posts!
    // change the check condition to the last post.
    $data = post_date
    $year = post_year

    end while

    So this is what I have in mind so far. Any better methods or help with coding the conditional aspects of that, much appreciated. I don’t even know how to get the current data, year, post date or post year. I guess I will have to format the meta. then I need to compare the dates, to decide whether or not they come either side of the boundary, and therefore require a new title. e.g. Spring $year.

    Would be great to hear the views of an experianced coder at this point – just to know i’m not off my rocker.
    Thanks
    A

    I am also looking for the solution to this problem, and others. I just want to custom format the contents of my posts which photoQ creates – without having to re-theme for that category of post! simple enough.

    If it was created by the script – surely it can be removed by the script?

Viewing 8 replies - 1 through 8 (of 8 total)