Problem with featured image support and Portfolio template

Homepage Community Forums Epik Theme Support Problem with featured image support and Portfolio template

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14124
    TrishaM
    Customer

      First, before I get into my problem, may I respectfully suggest that [the forum administrator] add the “create new topic” module to the FIRST page of Forum threads (or better still, every page), or some sort of link or shortcut to it. I’ve spent well over an hour (going on two) just trying to find where to post a new thread….this is the very first (of a great many) support forums I’ve been to that buries it on the very last page of threads, where it’s very hard to find.

      That said, here’s what I need help with.

      I needed to add featured image support (full width) to all single posts and pages, and did that successfully by adding the following code snippet to my (Epik) theme’s functions.php file:

      
      add_action( 'genesis_before_entry', 'featured_post_image', 8 );
      function featured_post_image() {
        is_singular(array( 'post', 'page' ));
      	the_post_thumbnail('full');
      }
      <!--formatted-->

      This works great EXCEPT that it creates a new problem with a Portfolio template page I created by modifying and renaming the one that comes with Epik (I like the stock one, but need to have some parent pages work the same way, displaying a “Portfolio-style” list of child pages). The modified Portolio template page works (I just changed the “loop” portion to use my own $args to find all child pages of the (parent) page being displayed).

      BUT on that page, the full width featured image is being displayed before each list item (child page)….the child pages themselves display nicely with the featured image as a thumbnail followed by the excerpt and read more….it all looks great except that in between each one is the full-width featured image, and because it takes up the full width each child page is listed by itself in the row, then it shows the next full width image followed by the child page info, etc.

      SO I thought “well I’ll just modify the code to NOT refer to pages (using is_singular(‘post’) instead of the array) and then add in code on the page.php template to display it there. In theory, then any page that uses page.php should display the featured image and any page that doesn’t use page.php but rather uses my new page-mycustomtemplate.php (same as page-portfolio.php with my custom loop in place of the portfolio loop) will NOT display the featured image (full width) but rather will use what is in the modified version of the portfolio template.

      BUT that isn’t what happens.

      Apparently Genesis, like WordPress, considers ALL content to be “posts” so it adds the featured image (full width) to ALL pages. Ok I can live with that as long as it isn’t in the Portfolio LOOP – I want the image at the top of the Parent Page (and it is) but I don’t want each child page’s featured image to show full width before each child page in the list items. EDITED: Actually it is NOT showing the Parent Page’s featured image, I just thought it was because it’s the same image as the first Child Page…so my problem is in the Portfolio Page template….I need to be able to assign a (similar) template to Parent Pages for which I want Child pages displayed the same way as the Portfolio Page, with the Parent Page also showing it’s featured image full width. I hope this makes sense.

      In the customizations I made to the duplicated page-portfolio.php template I ONLY changed the $args to this:

       $args = array( 
      	  'post_type' => 'page',
            'post_status' => 'publish',
            'posts_per_page' => -1,
            'caller_get_posts'=> 1,
      	  'post_parent' => 13,
      	  'orderby' => 'title',
      	  'order' => 'ASC'
      	  );
      <!--formatted-->

      And I removed the reference to $cf since I’m not using custom fields to declare a category.

      Can someone please help with this?

      Here’s a link to the Page that I’m having trouble with…..understand that if I figure it out, it may look fine ๐Ÿ™‚ But if I do I’ll post back what I did to solve it.

      http://www.sunsettravel.com/free-tools/

      #14125
      TrishaM
      Customer

        UPDATE: I did figure this out…..

        I REMOVED the code from functions.php that adds featured image support to before the post title on posts & pages…..then on page.php I added it back in minus the is_singular test since obviously you’re already on a single Page.

        In order to get this to work on single posts as well as single pages, I had to copy & rename the single.php file from the Genesis theme, and add the same code snippet at the top.

        #14129
        Eric
        Customer

          Glad you got this figured out!

          Yes to create a new post in the forum is the exact same as all other bbPress forums including StudioPress – http://www.studiopress.com/forums/forum/general-discussion/ You simply select the forum you want to create a post in, and then scroll to the bottom and you’ll see where to post. Thats how all bbPress forums work, there are probably over 100,000 other bbPress forums that operate the same way. Sorry it took so long to figure out, but at least you’ll know for next time.

          Thanks for keeping us updated on getting everything figured out ๐Ÿ™‚


          I create awesome sites for awesome people! Contact me if interested โ€“ ericsanchez1585@gmail.com

          #14136
          TrishaM
          Customer

            Hi Eric,

            Actually I’ve installed many bbPress Forums, I’ve been doing this for 10 years…..where the “new topic” form is located is controlled by the bbPress Theme, and although this is a very nice bbPress Theme being used here, it’s the first I’ve seen that makes one find their way to the very last page to find the New Topic form. Most have it at the bottom of the first page, or some have it on every page. All (that I’ve come across) have a ‘shortcut’ link to it at the top that just says something like “New Topic” or “Post New Thread” and when you click on that it jumps to the form. It’s a Theme issue, not bbPress.

            AND I still need help……I thought this was resolved, but I’m only 75% of the way there.

            I need the Parent Page’s Featured image to display above the Page title, then the page content, then the loop that finds all Child Pages and displays them in the Portfolio style. I have all of that working now EXCEPT the featured image for the parent page.

            Whenever I try to add some code to the template to display the page’s thumbnail (at full size), it adds it instead into the loop (?) and messes up the child page loop results layout by adding every child page’s featured image (at full size) instead of the Parent page’s image….even though I’m using what is supposed to be the correct hook, genesis_before_entry (this is fired way before the loop is).

            Can someone please tell me exactly what to add to the Portfolio Page template to display whatever Parent Page is assigned to that template’s featured image, once, above the page title?

            Thanks!

            #14144
            TrishaM
            Customer

              Well I got this one resolved, thought I’d post my solution in case anyone else wants to do the same thing (Display a full-width Featured Image at the top of the page for pages that use the Portfolio Template). This puts the image above the Page Title.

              First, backup your page-portfolio.php and keep it somewhere safe. Then open that file in a text editor, and add these lines of code at the top BELOW the Template name:

              
              // Adds Full Width Featured Image above title on Pages that use this Portfolio Template
              remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
              add_action( 'genesis_before_content_sidebar_wrap', 'featured_post_image', 8 );
                function featured_post_image() {
              	the_post_thumbnail('full');
              }
              

              Naturally this assumes that you’ve assigned a Featured Image to the Page that you apply this Template to, and as I’ve done, ensured that the image is a full-width (1140px wide) image.

              Once you’ve updated the Template, you’ll get the full width image below the header and above the Post title, then whatever content you may have on the Page, then the loop that creates the ‘portfolio’ of post or page links.

              I hope someone finds this helpful. ๐Ÿ™‚

              #14149
              Eric
              Customer

                As far as the forum topic, here is an example of what I was referring to – http://www.studiopress.com/forums/ If you look at StudioPress’ main forum page, it’s setup exactly like Appfinite’s homepage – https://appfinite.com/forums/ You basically select the forum you want to post in first, and then once you’re there, you scroll to the bottom of that forum and you can add a post. It’s pretty much the same way. I agree, a new topic link would be useful, but we would still have to select which part of the forum we’re creating the topic in…..which is why this page exists – https://appfinite.com/forums/ In other words, they keep the forum Organized by theme, so when someone posts a topic it’s added inside of the theme category they are using…….I’m sure you already know all of this, but I’d thought I’d share for anyone else that is wondering how/why it’s setup this way.

                I’m glad you got everything figured out and thanks for posting your solution ๐Ÿ™‚

                I also want to thank you for all of your help and contributions you’ve been doing recently. It really feels good to see other members helping each other out. That’s what the WordPress community is all about!


                I create awesome sites for awesome people! Contact me if interested โ€“ ericsanchez1585@gmail.com

                #15448
                pcgs51
                Customer
                  This reply has been marked as private.
                Viewing 7 posts - 1 through 7 (of 7 total)
                • The topic ‘Problem with featured image support and Portfolio template’ is closed to new replies.