• 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 Action on Single Post Template

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 Action on Single Post Template

This topic is: not resolved

Tagged: Custom Post Type, metabox

  • This topic has 1 reply, 1 voice, and was last updated 12 years, 8 months ago by juiceman.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 16, 2014 at 1:30 pm #85526
    juiceman
    Participant

    I have done something similar to what I am trying to do in the past but want to get my templates cleaned up and make use of the hooks.

    Here is the url:
    http://wildbirddigest.com/birds/brewers-blackbird/

    I have a Custom Post Type called ssbd_birds. The template I am working on is single-ssbd_birds.php

    I have some custom metaboxes that I would like to output into the template. The one shown is ssbd_summerview.
    It worked on my old templates but I cannot get it to show in my new action.

    1. How do I call for my custom metaboxes?

    2. I would also like to be able to call for the featured image in the same fashion?

    <?php
    // Template Name: Single Bird Posts
    
    // remove_action( 'genesis_entry_header', 'streamline_post_image', 1 );
    
    remove_action( 'genesis_entry_header', 'genesis_post_info', 2 );
    
    add_action('genesis_entry_content', 'ssbd_show_views', 1);
    function ssbd_show_views() { ?>
    
    	<p><img src="<?php $key="ssbd_summerview"; echo get_post_meta($post->ID, $key, true); ?>" /></p>
    
    	<p>I can get this paragraph to show, but not the image above.</p>
     
    <?php }
    
    genesis();

    Any help is greatly appreciated!

    Thanks

    http://wildbirddigest.com/birds/brewers-blackbird/
    January 17, 2014 at 1:17 pm #85667
    juiceman
    Participant

    I have figured out how to get the values of the custom meta boxes in. But only text ones. I have two meta boxes that are file uploads and am unable to get the images to diaplay.

    Is there something wrong with the code I'm using?

    Also, I cant get the post content to start AFTER/UNDER the two column top section. Is something not clearing correctly? I've tried to clear: both in may ways but can't seem to make it work.

    Any suggestions are greatly appreciated! Thanks!

    <?php
    // Template Name: Single Bird Posts
    
    remove_action( 'genesis_entry_header', 'streamline_post_image', 1 );
    remove_action( 'genesis_entry_header', 'genesis_post_info', 2 );
    
    add_action('genesis_entry_content', 'ssbd_show_views', 1);
    	function ssbd_show_views() { ?>
    
    	<div class="one-half first">
    		<?php genesis_image(); ?>
    	</div>
    
    	<div class="one-half">
    		<?php add_action( 'genesis_post_content', 'summerfield' );
    		function summerfield() {
        		genesis_custom_field( 'ssbd_summerview' );
    		} ?>
    
    		<p>I can get this paragraph to show, but not the image above.</p>
    
    	</div>
    
    <?php }
    
    add_action('genesis_entry_content', 'ssbd_favorite_foods', 10);
    function ssbd_favorite_foods() { ?>
    
    <p><span style="font-weight: 700;">Suggested Feeder Types:</span> <?php genesis_custom_field('ssbd_feedertypes'); ?> <a href="http://wildbirddigest.com/birds/bird-feeders/" title="About Bird Feeders">(about bird feeders)</a></p>
    
    	<div class="one-third first">	<h3>Seeds/Grains</h3>
    		<?php genesis_custom_field('ssbd_favoredseedgrains'); ?>
    		</div>
    	<div class="one-third">	<h3>Fruits</h3>
    		<?php genesis_custom_field('ssbd_favoredfruits'); ?>
    		</div>
    	<div class="one-third">	<h3>Nuts</h3>
    		<?php genesis_custom_field('ssbd_favorednuts'); ?>
    		</div>
    
    <?php }
    
    genesis();
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 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