• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Adding image to slider

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding image to slider

This topic is: resolved

Tagged: custom, Excerpt, posts, slider

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 2 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 9, 2016 at 9:28 am #195948
    teebark
    Member

    I have the Agency child installed, and I want to be able to add an image to the excerpt. Genesis treats the image as the 'featured image' and places it separate from the excerpt. I do not want a featured image, I want to add it to the excerpt slide/post (my option for slides is posts instead of pages). The slider posts are category 'slider'.

    So, I am trying to add a hook 'get_the_excerpt' to the posts php page, like this, but it's not working. I've also added a custom post type, 'image_excerpts' with a custom field name content, field group name excontent, and slug excontente.

    If you select the slider for company ACECF (second one), you'll see that the image is on the left of the image, and the excerpt on the right. I want both the image and the excerpt to be in the excerpt on the right, just as in a normal post.

    Am I on the right track, or is there an easier way of doing this?

    add_filter( 'get_the_excerpt', 'child_do_image_excerpt' );
    function child_do_image_excerpt( $excerpt ) {

    if( 'slider' != get_the_category() )
    return $excerpt;

    global $post;

    $content = '<div class="slider-quote">'. wpautop( $post->content ) . '</div>';
    $excontent = ( $name = genesis_get_custom_field( 'wpcf-excontente' ) ) ? '<p class="author">'. $name .'</p>' : '';

    return $content . $excontent;

    http://thefacesofhope.org/v3/
    December 28, 2016 at 9:00 am #198339
    Susan
    Moderator

    I am closing this, as you have marked it resolved. If you are still having issues, please go ahead and start a new thread.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Adding image to slider’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble