Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter thiesenmurray

    (@thiesenmurray)

    Guys, I fixed it by myself. Here’s the code with comments

    <!-- here starts the normal loop -->
    <?php query_posts( 'post_type=events'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    	<!-- There's a count in the loop that starts at zero. After 3 he break's the loop -->
    	<?php static $count = 0;
    	if ($count == "3") { break; }
    	else { ?>
    
    		<!-- The normal loop -->
    		<div class="test">
    			<h1><?php the_title(); ?></h1>
    			<?php the_content(); ?>
    		</div>
    
    	<!-- before running the loop again, php adds 1 up in the count variable -->
    	<?php $count++; } ?>
    	<?php endwhile; ?>
    
    	<!-- Setting a if statement. If the loop is 1, then show another loop with an custom post type -->
    	<?php if ( $count == "1" ) { ?>
    		<?php query_posts( 'post_type=media&showposts=2'); ?>
    			<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    				<div class="test">
    					<h1><?php the_title(); ?></h1>
    					<?php the_content(); ?>
    				</div>
    			<?php endwhile; ?>
    		<?php endif; ?>
    	 <?php } ?>
    
    	<!-- Setting a if statement. If the loop is 2, then show another loop with an custom post type -->
    	<?php if ( $count == "2" ) { ?>
    		<?php query_posts( 'post_type=media&showposts=1'); ?>
    			<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    			     <div class="test">
    			     	<h1><?php the_title(); ?></h1>
    			     	<?php the_content(); ?>
    			     </div>
    			<?php endwhile; ?>
    		<?php endif; ?>
    	<?php } ?>
    
    <?php endif; ?>
    Thread Starter thiesenmurray

    (@thiesenmurray)

    I’m sorry, this is the code without the custom labels

    `<?php echo tally_graph(‘key=gegroeide_bomen&tally_interval=month&interval_count=50&to_date=2010-12-10
    &chs=940×230&cht=lc&chma=50,50,50,50&chf=bg,s,4a7c4000&chls=5&chco=dc5408&chxs=FF0000&chxs=0,ffffff|1,ffffff’); ?>

    Thread Starter thiesenmurray

    (@thiesenmurray)

    I got an email from Michael and he helped me out. I will show the answer for others that experience the same problem. The solution is SESSIONS. With SESSIONS you can transfer data from one page to another.

    if ( !session_id() )
    add_action( 'init', 'session_start' );
    
    $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix');
    $noUnset = array('_SESSION','GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix');

    Then add this to your sendmail script:

    $address = $_SESSION['form_mail'];

    Now put the following code to the page where you have your form:

    $_SESSION['form_mail'] = get_option('your_custom_email');

    You store the string ‘your_custom_email’ in a session and put it in a variable in the contact script. I wanted to store a custom field in de session so my final code was

    <?php $_SESSION['form_mail'] = get_post_meta($post->ID, 'the name of my custom field', $single = true); ?>

    Hope this helps more people.

    Thijs

    It’s as simple as switch between theme’s in appearance. After that the functions works if you already made a custom page template.

    Thread Starter thiesenmurray

    (@thiesenmurray)

    Strange, the code didn.t work with the default theme but I found out that I works without the timthumb script… Also on my own theme.

    Yes I have a .htaccess file for the new permalink structure. This morning it didn’t crash and I got rid of the timthumb script.

    Now I looking for another resizing PHP script.

    Thread Starter thiesenmurray

    (@thiesenmurray)

    Esmi,

    Thanks for the quick response!

    It’s very strange. I only run the contact form 7 plugin but I’m gonna switch it off, maybe that’s the reason. Besides the re-installing I found another strange thing. The theme doesn’t display my custom field thumbs. It hasn’t anything to do with the code because I copy/paste it from an old site of mine.

    If the re-install script starts it re-directs me from the normal url to the install folder so when I type https://www.goede-zaak.nl I get the install options (goede-zaak.nl/wp-admin/install.php). Something to worry about because when this happens when someone visits the site, he gets full control about the installation…

    Thijs

    For me it also was the functions file. I had a filter that limits the excerpt. This was the trouble maker… Now I use a excerpt editor plugin.

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