• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2787

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Add Link In Genesis Entry Meta

The 1st code snippet in this tutorial creates a new shortcode which enables you to add a link to the entry meta in the entry footer. In this case, it adds a link for a disclosure policy.

Once you create the shortcode, you can then add it using the genesis_post_meta filter hook which adds it to the post meta in the entry footer. You can add the shortcode before or after the categories and tags.

Add the following code to your child themes functions file.

add_shortcode( 'disclosure', 'genesis_disclosure_link_shortcode' );

function genesis_disclosure_link_shortcode( $atts ) {

    $link = sprintf( '<a href="%s">%s</a>', esc_url( 'http://example.com/' ), 'Disclosure Policy' );

	$defaults = array(
		'after'  => '',
		'before' => __( 'FTC Compliance: ', 'genesis' ),
		'link'   => $link,
	);

	$atts = shortcode_atts( $defaults, $atts, 'disclosure' );

	$output = sprintf( '<span %s>', genesis_attr( 'disclosure-policy' ) ) . $atts['before'] . $atts['link'] . $atts['after'] . '</span>';

	return $output;

}

Also add the following code:

If you want to add a link in the entry meta ( post info ) in the entry header on single posts, use the following code:

Here’s one example:

You could also add it using the shortcode with the genesis_post_info filter function.

Related Tutorials

  • 2 Ways To Modify The Genesis post_date Shortcode

Entry Meta

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.