WordPress.org

Ready to get started?Download WordPress

Forums

Pull images and text to homepage content boxes (5 posts)

  1. kkhalifax
    Member
    Posted 3 years ago #

    Hi there,

    I am using the Cool theme and have three content boxes running along the bottom. They are configured to pull the first lines of text from three separate pages as 'teaser' copy. The first lines of text are pulled from the first text box on these landing pages.

    If I place an image in this same area on the landing pages the images do not get pulled and do not appear in the content 'teaser' boxes of the homepage. Is it possible to simply plug absolute image urls into the index.php file or is there another way to fix this issue?

    Website is oneeightycorp.com/en

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    It very much depends upon what code is being used to create the content for those boxes. My guess is that the relevant code uses something like the_excerpt() so you could try posting your teaser text and image in the Excerpt box on each Edit Post page.

  3. kkhalifax
    Member
    Posted 3 years ago #

    Thanks esmi

    The index.php page uses the following code for each of the three boxes:

    <div class="grid_4 alpha">
    <?php query_posts('page_id='.get_option('column1'));
    while (have_posts()) : the_post(); ?>
    <h3 class="title-icon1">
    <?php the_title(); ?>
    </h3>
    <p>
    <?php the_content_rss('cut', TRUE, '', 19); ?>
    </p>
    " class="view-more"> 

    <?php endwhile; ?>
    </div>

    The only difference are the names of the div classes. The line in question is <?php the_content_rss('cut', TRUE, '', 19); ?> which, if I swap out with an absolute image url I can manually override the problem. Are there changes I can make to that code to allow it to pull images as well as text? Thanks.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Try <?php the_content_rss('cut', TRUE, '', 19, 2); ?>

    http://codex.wordpress.org/Function_Reference/the_content_rss

  5. kkhalifax
    Member
    Posted 3 years ago #

    esmi,

    This was really helpful. I plugged in <?php the_content_rss('cut', TRUE, '', 19, 2); ?> and nothing seemed to happen, but having read the link you sent I tried a few different variations. I plugged in '3' instead of '2' and that seemed to do the trick.

    Unless there are any problems you foresee with that coding, thank you so much for fixing a big problem of ours.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags