Combining similar shortcode functions?
I don’t know exactly what you are trying to do but perhaps something like this: function customfields_shortcode( $atts ) { if (!empty($atts[‘field’]) && get_post_meta( get_the_ID(), $atts[‘field’], true ) ) { $customfield = get_post_meta( get_the_ID(), $atts[‘field’], true ); return “custom field >> $customfield << custom field”; } } add_shortcode( ‘mycustomfields’, ‘customfields_shortcode’ ); echo do_shortcode(‘[mycustomfields field=”customfield_1″]’); One … Read more