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

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems