Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9182269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:31:14+00:00 2026-06-17T18:31:14+00:00

We have been trying to get the featured image to show for this block

  • 0

We have been trying to get the featured image to show for this block on CMS homepage but so far unsuccessful using FishPig WP Integration extension on Magento v1.7.0.0. However, we are successful in other content from the blog’s post to show from specified category.

What we are looking to do is get 2 images to show per post. The rest is good to go. Each section is considered a post. I’ve linked two screenshots with explanations for visual aid.

The area on the dev site where we are trying to get this done on is:
https://devtest.eboost.com

The relevant block of code for the Press section is

<div id="pressblock">
  <?php

    //$press_posts = Mage::getResourceModel('wordpress/image')->addIsPublishedFilter()->addCategorySlugFilter('press');
    $press_posts = Mage::getResourceModel('wordpress/post_collection')->addIsPublishedFilter()->addCategorySlugFilter('press');
    $presstotal = count($press_posts->getAllIds());
    $presstotid = $press_posts->getAllIds();

    //i<=2 means displays last 2 posts
    //display latest 2 posts...
    $k = 0;
    $nopages = ceil($presstotal/6);
    $pag = 1;
    for($j=$presstotal - 1; $j>=0; $j--)
      {
        $k++;
        if($k == 1)
          {
            if($pag == 1)
              {
                echo '<section id="page-'.$pag.'" class="active">';
                $pag++;
              }
            else
              {
                echo '<section id="page-'.$pag.'">';
                $pag++;
              }
          }
    ?>
        <div class="<?php if($k%2 == 0) echo 'press_right'; else echo 'press_left';?>">
          <div class="pree_emty">

            <?php
              /*
                GPSM 01-23-13:
                Some attempts to get the featured image to show. I don't see a variable to display any image really. The only thing that shows image is post_content but that shows the content as well... Maybe we can filter the image from there?

                Maybe we can use some of the code from "app/design/frontend/default/eboost/template/wordpress/post/list.phtml" or something.

                The following StackOverflow post looks to have promising suggestions:
                http://stackoverflow.com/questions/10169968/wordpress-posts-on-magento

                Check "app/code/community/Fishpig/Wordpress/Model/Image.php" for functions to display image stuff
              */
              //echo $press_posts->getItemById($presstotid[$j])->post_content;
              //print_r($press_posts->getItemById($presstotid[$j]));
              //echo $press_posts->getItemById($presstotid[$j])->getFeaturedImage();
            ?>


            <img src="<?php echo $press_posts->getItemById($presstotid[$j])->getFeaturedImage(); ?>" width="204" height="204" alt="" />
            <?php/*<img src="<?php echo $this->getSkinUrl('images/pree_emty.png');?>" width="204" height="204" alt="" />*/?>
          </div>

          <div class="press_txt">
            <h3><?php echo $press_posts->getItemById($presstotid[$j])->getPostTitle(); ?></h3>
            <p><?php echo substr(strip_tags($press_posts->getItemById($presstotid[$j])->getPostContent()), 0, 150); ?></p>
            <p><a href="#"><img src="<?php echo $this->getSkinUrl('images/viewfull_btn.png');?>" width="168" height="30" alt="" /></a></p>
          </div>
        </div>
    <?php
        if($k >= 6)
          {
            echo "</section>";
            $k = 0;
          }

      }
        if($k < 6)
          {
            echo "</section>";
          }
    ?>
  </div><!--#pressblock-->

2 screenshots for visual aid:

Screenshot#1

Screenshot#2

Best Regards,

George

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:31:15+00:00Added an answer on June 17, 2026 at 6:31 pm

    Figured it out…

    Essentially we pulled the custom field image from the posts. We will be making another custom field for the posts for another image. So, one image from post will be for the frontpage->press block and the second image will be displayed in a fancybox overlay.

    Here is the relevant code snippet:

    http://www.filedropper.com/code_1

    ^^ posting the code this time around screwed with the formatting and figured to just save it to a file “code.php”, upload to free upload site, post here… I followed the posting instructions like last time to post the snippet but I must be doing something wrong but don’t have time now to figure that out…

    Regards,
    George

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been breaking my head trying to get this working but I can't
I have been trying to get a handle on using MVC 4.0 with EF
I have been trying to get LastBootUpTime using Win32_OperatingSystem class (WMI). HRESULT hr =
I have been trying to get this one section of my UI to immediatly
I am using Orchard CMS and the Bootstrap theme. I have been trying to
I have been at this for a good few hours, but I cant get
I have been trying to get my Arduino/Eclipse environment setup. For some reason I
I have been trying to get Twitter Bootstrap btn-group with dropdown to work for
I have been trying to get tsung to connect to a box I have
I have been trying to get a custom Value from the Custom Field that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.