Customize entry content

Community Forums Forums Design Tips and Tricks Customize entry content

This topic is: not resolved

Tagged: 

This topic contains 8 replies, has 2 voices, and was last updated by  sheilab 1 year, 10 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #12154

    sheilab
    Participant
    Post count: 16

    I have a client who would like a paragraph to the right of a slideshow for each of her posts.

    Can you point me in a direction as to how I could do this?   The slideshow can  be implemented with short code or as a widget. I could have her set up a different simple sidebar for each post but she is not that savvy and as the site grows, that would be lots of sidebars.

    Using Outreach 2 theme.

    http://www.bergmanmediaservices.com/project-2/

    #12166

    SoZo
    Moderator
    Post count: 1573

    Are the paragraphs going to be unique to each post? If so I would pull the text from a custom field. Or if you are using a slideshow with shortcode then you could add the text right after the shortcode and float it.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #12178

    sheilab
    Participant
    Post count: 16

    Thanks! Custom fields and CSS should work for me here. I have put this code into my functions.php file but am getting a syntax error and I just can’t see it. Please advise.

    /* add custom fields smb*/

    if( genesis_get_custom_field( ‘slideshow_shortcode’ )
    echo ‘<div class=”slideshow_shortcode”>’ . genesis_get_custom_field( ‘slideshow_shortcode’ ) .'</div>';

    if( genesis_get_custom_field( ‘project_description’ )
    echo ‘<div class=”project_description”>’ . genesis_get_custom_field( ‘project_description’ ) .'</div>';

    #12179

    sheilab
    Participant
    Post count: 16

    When I submit a reply to this post, I am sent to a 404 page.

    #12350

    SoZo
    Moderator
    Post count: 1573

    What is the syntax error and what else are you putting in functions.php?


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #12502

    sheilab
    Participant
    Post count: 16

    I found the syntax error, I was missing the end parenthesis in my functions. I’m seeing the custom fields now but I still need help getting the slideshow short code to read as short code.   http://www.teripower.dev/project-2/

    This is the code in my functions.php file:

    /** Add custom fields to project category posts smb*/
    add_action( ‘genesis_post_content’, ‘child_custom_field’ );
    function child_custom_field() {
    if( genesis_get_custom_field( ‘slideshow_shortcode’ ))
    echo ‘<div class=”slideshow_shortcode”>’ . genesis_get_custom_field( ‘slideshow_shortcode’ ) .'</div>';
    if( genesis_get_custom_field( ‘project_description’ ))
    echo ‘<div class=”project_descriptione”>’ . genesis_get_custom_field( ‘project_description’ ) .'</div>';
    }

    I’ve played with adding parts of the code below to the code above and also tried wrapping parts of  it around the short code’s custom field value when I define it in the post editor but can’t get it right. The short code calls a slideshow. Should I post this as a new topic?

    echo do_shortcode(“[Shortcode]”);

    I’m getting closer.

    Thanks!

    Sheila

    #12664

    SoZo
    Moderator
    Post count: 1573

    If you want to enter the shortcode into the custom field then you need to edit echo do_shortcode(“[Shortcode]“); and replace “Shortcode” with the custom field output. i.e. echo do_shortcode(“[. genesis_get_custom_field( ‘slideshow_shortcode’ ) .]“);


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #12717

    sheilab
    Participant
    Post count: 16

    I have added the do_shortcode function to the echo command and have tried for hours to get rid of this parse error:

    Parse error: syntax error, unexpected ‘[‘ in /Users/bergman/Documents/Websites/www.teripower.dev/wp-content/themes/outreach/functions.php on line 81     (line 81 is the  echo do_shortcode  line for the slideshow_shortcode.)

    Please take a look and see what I’m doing wrong. Thanks.

    /** Add custom fields to project category posts smb*/
    add_action( ‘genesis_post_content’, ‘child_custom_field’ );
    function child_custom_field() {

    if( genesis_get_custom_field( ‘slideshow_shortcode’ ))
    echo do_shortcode(“[. genesis_get_custom_field( ‘slideshow_shortcode’ ) .]“);

    if( genesis_get_custom_field( ‘project_description’ ))
    echo ‘<div class=”project_descriptione”>’ . genesis_get_custom_field( ‘project_description’ ) .’</div>’;
    }

     

    #14438

    sheilab
    Participant
    Post count: 16

    This is the final working version of the code that worked for me:

    /** Add custom fields to project category posts smb. This works.*/
    add_action( ‘genesis_post_content’, ‘child_custom_field’ );
    function child_custom_field() {
    if( genesis_get_custom_field( ‘project_description’ ))
    echo ‘<span class=”project_description”>’,
    genesis_get_custom_field( project_description ) ,'</span>';
    if( genesis_get_custom_field( ‘slideshow_shortcode’ ))
    echo ‘<span class=”slideshow_shortcode”>’, do_shortcode(”. genesis_get_custom_field( ‘slideshow_shortcode’ ) .”),'</span>';
    }

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.