Forum Replies Created

Viewing 15 replies - 31 through 45 (of 79 total)
  • Thread Starter Kai2810

    (@kai2810)

    Anyone?

    Thanks!

    Thread Starter Kai2810

    (@kai2810)

    It WORKED!

    THANKS A LOT Guillermo!

    Here’s what I did, after finally understanding how the loop works, LOL.

    <?php get_header(); ?>
    <div class="home is-single fix">
        <div class="left1">
            <?php include (TEMPLATEPATH . '/sidebar.php'); ?>
        </div>
        <div class="right1">
            <div class="recent-leads fix">
                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                <div id="post-<?php the_ID(); ?>" class="<?php echo ( is_first_post($post->ID) ) ? 'main-post-bg' : 'secondary-post-bg left'; ?>">
                    <?php if ( is_first_post($post->ID) ) $img_src = get_post_meta($post->ID, 'lead_image', true);
                        else $img_src = get_post_meta($post->ID, 'secondary_image', true);
                        if ( $img_src == '' ) $img_src = '/wp-content/themes/theunstandard/images/theunstandard-blank.png';
                    ?>
                    <?php include (TEMPLATEPATH . '/includes/index_dynamic.php'); ?>          
    
                    <div class="title-insert">
                        <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                    </div>
                </div>
                <?php endwhile; ?>
                <div class="entry navigation radius-link fix">
                    <br class="clear" />
                    <p class="left"><?php previous_posts_link('&laquo; previous'); ?></p><p class="right"><?php next_posts_link('next &raquo;'); ?></p>
                </div>
                <?php else : ?>
                <div class="post single">
                    <h2>No matching results</h2>
                    <div class="entry">
                        <p>You seem to have found a mis-linked page or search query with no associated or related results.</p>
                    </div>
                </div>
                <?php endif; ?>
    
    <?php query_posts('page_id=294');?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_content();?>
    <?php endwhile; ?>
    <?php endif; ?>
    
            </div>
        </div>
    </div>
    <?php get_footer(); ?>

    Hi guys, I think I’m having the same problem, trying to embed Contact Form 7 into my template php file.

    semrocc, do you mind showing how you use the do_shortcode() function?

    I’m a noob in php…

    Thread Starter Kai2810

    (@kai2810)

    Hi esmi!

    THANKS for replying, and for the link about get_posts. Just asking…since I just need a single post, shouldn’t get_post be better suited for this?

    I tried the code you recommended, but the category page did not display the single post containing the ContactForm7 code.

    Instead, I think it displayed the content of the posts addressed in The Loop. Just to clarify, my category page is showing just the title of the single post (a product page basically) and a thumbnail associated with it.

    Here’s the link.

    Here’s the entire code of that category page.

    <?php get_header(); ?>
    <div class="home is-single fix">
        <div class="left1">
            <?php include (TEMPLATEPATH . '/sidebar.php'); ?>
        </div>
        <div class="right1">
            <div class="recent-leads fix">
                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                <div id="post-<?php the_ID(); ?>" class="<?php echo ( is_first_post($post->ID) ) ? 'main-post-bg' : 'secondary-post-bg left'; ?>">
                    <?php if ( is_first_post($post->ID) ) $img_src = get_post_meta($post->ID, 'lead_image', true);
                        else $img_src = get_post_meta($post->ID, 'secondary_image', true);
                        if ( $img_src == '' ) $img_src = '/wp-content/themes/theunstandard/images/theunstandard-blank.png';
                    ?>
                    <?php include (TEMPLATEPATH . '/includes/index_dynamic.php'); ?>          
    
                    <div class="title-insert">
                        <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                    </div>
                </div>
                <?php endwhile; ?>
                <div class="entry navigation radius-link fix">
                    <br class="clear" />
                    <p class="left"><?php previous_posts_link('&laquo; previous'); ?></p><p class="right"><?php next_posts_link('next &raquo;'); ?></p>
                </div>
                <?php else : ?>
                <div class="post single">
                    <h2>No matching results</h2>
                    <div class="entry">
                        <p>You seem to have found a mis-linked page or search query with no associated or related results.</p>
                    </div>
                </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
    <?php get_footer(); ?>

    I tried placing it before and after the <?php endwhile; ?> portion of the code, but somehow I think the <?php the_content();?> you recommended using is still referring back to the posts retrieved in the loop?

    Please advice.

    Thread Starter Kai2810

    (@kai2810)

    Please ignore the above post…I was trying to get the code to be displayed with b-quotes.

    Here’s the code I’m having trouble with.

    <?php
    $categories = get_categories('child_of=1&orderby=ID&hide_empty=0');
    foreach ($categories as $cat) {
    	if ($cat->category_parent != 0) {
    		echo '<span style="padding-left:10px;">';
    	}
    	echo '<div class="title-insert main-post-bg-a showhero">
            <h2><a href="'.get_option('home').get_option('category_base').'/'.$cat->category_nicename.'/">'.$cat->cat_name.'</a></h2>
    </div> ';
    	echo '<br />';
    }
    ?>

    Please advice!

    Thread Starter Kai2810

    (@kai2810)

    guys…any help please? ??

    Hey cheriejd, if you are still having this prob, just found it from another forum post.

    Click here

    Anyone has a solution to this problem?

    I’m looking at this too.

    Thread Starter Kai2810

    (@kai2810)

    Oh anything that may help, here’s the block of code that generates the blog spots to display in the fashion which I want my sub categories to follow.

    Found this in the index.php

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div id=”post-<?php the_ID(); ?>” class=”<?php echo ( is_first_post($post->ID) ) ? ‘main-post-bg’ : ‘secondary-post-bg left’; ?>”>

    <?php if ( is_first_post($post->ID) ) $img_src = get_post_meta($post->ID, ‘lead_image’, true);
    else $img_src = get_post_meta($post->ID, ‘secondary_image’, true);
    if ( $img_src == ” ) $img_src = ‘/wp-content/themes/theunstandard/images/theunstandard-blank.png’;
    ?>

    <?php include (TEMPLATEPATH . ‘/includes/index_dynamic.php’); ?>

    <div class=”title-insert”>
    <h3>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h3>
    </div>
    </div>
    <?php endwhile; ?>

    Thread Starter Kai2810

    (@kai2810)

    It works perfectly!

    LOL I was looking through my files using Filezilla after my own modification, and found a pic file with a 0 after the .jpg filename, rendering the pic a .jpg0 file.

    Realized I placed the postID directly after the $filename…

    Looks like my coding skills have a long way to go!

    Thanks again Mark!

    Thread Starter Kai2810

    (@kai2810)

    Hey Mark, I tried modifying the code as you suggested, into the following.

    // move file
          $postdir = $options['path'];
          tdomf_recursive_mkdir($postdir,TDOMF_UPLOAD_PERMS);
          $count = 0;
    while(file_exists($newpath)) {
    $newpath = $postdir.DIRECTORY_SEPARATOR.$post_ID.'_'.$theirfiles[$i]['name'];
    }

    I gave me the following errors.

    Warning: rename(/home/********/public_html/********/wp-content/gallery/food/tmp/1/admin/P1030298.JPG,) [function.rename]: No such file or directory in /home/********/public_html/********/wp-content/plugins/tdo-mini-forms/include/tdomf-upload-functions.php on line 557

    Warning: Cannot modify header information – headers already sent by (output started at /home/********/public_html/********/wp-content/plugins/tdo-mini-forms/include/tdomf-upload-functions.php:557) in /home/********/public_html/********/wp-content/plugins/tdo-mini-forms/tdomf-form-post.php on line 242

    Anything I did wrong?

    Thread Starter Kai2810

    (@kai2810)

    Anyone with any advice?

    Thread Starter Kai2810

    (@kai2810)

    I just resolved a issue with TBO Mini Form, image files are uploaded correctly into the correct NextGEN gallery folder, but the plugin still won’t detect them.

    The number of items in my gallery still remains the same even after a new image file has been uploaded…

    Any way to get the plugin to recognize the new uploaded files?

    Thread Starter Kai2810

    (@kai2810)

    oh…conflict between similar file names…didn’t think about that.

    Is it possible to do a IF-ELSE statement? Say if the file uploaded conflicts with another file with a similar name, it will add a running number behind the new file’s name?

    Much like how Windows handles duplicate file names?

Viewing 15 replies - 31 through 45 (of 79 total)