Shortcode not working
-
I have a problem using the shortcode in a custom buddypress tab. Here’s the code of the bp-custom.php file:
`<?php
function profile_tab_myarticles() {global $bp;
bp_core_new_nav_item(
array(
‘name’ => ‘I miei articoli’,
‘slug’ => ‘my_articles’,
‘screen_function’ => ‘myarticles_screen’,
‘position’ => 40,
‘parent_url’ => bp_loggedin_user_domain() . ‘/my_articles/’,
‘parent_slug’ => $bp->profile->slug,
‘default_subnav_slug’ => ‘my_articles’,
)
);
}add_action( ‘bp_setup_nav’, ‘profile_tab_myarticles’);
function myarticles_screen() {
add_action( ‘bp_template_content’, ‘myarticles_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}function myarticles_content() {
if ( is_user_logged_in() )
{
echo do_shortcode(‘[frontier-post]’);
}
else
{
wp_login_form( array( ‘echo’ => true ) );
}
}?>’
The code works great and the new tab is created but the shortcode doesn’t show anything. Thanks in advance for your support!
The topic ‘Shortcode not working’ is closed to new replies.