Shortcodes in the functions.php file not working
-
I am trying make the shortcodes work, but it isn’t working. What I am really trying to do is to create a functions.php file with shortcodes, then place the shortcodes into a page via the Add New Page.
One of the shortcodes in the functions.php:
function contactus($atts) { extract(shortcode_atts(array( $contactus_page_post_id = 26, $contactus_page_post = get_post($contactus_page_post_id, ARRAY_A), $content_contactus = $contactus_page_post['post_content'], ), $atts)); return $content_contactus; } add_shortcode('contact', 'contactus');
With the actual shortcode like this: [contactus=”contact”]. Can someone please tell me how I can make the shortcodes work? Thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Shortcodes in the functions.php file not working’ is closed to new replies.