Shortcode into info tab

This topic contains 5 replies, has 3 voices, and was last updated by  urbanfix 8 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #43905

    leonce153
    Buyer
    Post count: 87

    Is there any way to insert a shortode into the info tab? I purchased a program that allows to put shortcodes into posts and pages of images. Users try and find the images and when found and clicked, keeps track of the images found, and upon finding all, can be redirected to a url for prize download, etc. I thought this would be a good way to drive users to detailed listings pages and run contests with prizes by offering clues of where to look. I tested a few months back and I’m pretty sure I was able to paste the shortcodes into the info tab of a listing and it worked. However, that was several updates and theme changes ago. When I try now, it doesn’t show anything. I created a custom field but it only displays the actual shortcode. I also tried this (https://wpgeodirectory.com/add-a-new-tab-in-the-listing-detail-page/) but when I place the shortcode in place of Hello World I get an error, and that way wouldn’t help as it would put the same shortcode in all listings, not just the chosen one. Any suggestions or assistance would be greatly appreciated as always.

    #43906

    leonce153
    Buyer
    Post count: 87

    Please disregard. I am able to place a shortcode inside the info tab as long as I place it before anything else, such as text.

    #44014

    Paolo
    Site Admin
    Post count: 31206

    Thank for letting us know 🙂

    #44072

    urbanfix
    Expired Member
    Post count: 310

    Hi @leonce153,
    Could you explain how you accomplished this?
    I have currently added my shortcodes using the tutorial, but as you stated its not the most flexible way!
    Thanks

    #44217

    leonce153
    Buyer
    Post count: 87

    Hi urbanfix,
    I haven’t yet tried adding tabs through the backend then pasting shortcodes (but will soon). I just needed a shortcode to appear within the Profile tab. I found that as long as I paste the shortcode above the text it works fine, but anywhere else, it wouldn’t display. It was important to do it this way because the contest I’m running includes a third party plugin that allows to place shortcodes of images in pages and posts, then keeps track of when they are found. Therefore it couldn’t show up on all listings and had to be on chosen listings only. I will attempt to make a generic tab through the custom fields settings and try that way also. If it works I will let you know.

    #44265

    urbanfix
    Expired Member
    Post count: 310

    Thankyou for clarifying!

    If by the backend you mean PHP, here’s a working example;

    
    
    <?php add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
     	$tab_array['TITLE'] = array( 
    										'heading_text' =>  __('TITLE',GEODIRECTORY_TEXTDOMAIN),
    										'is_active_tab' => false,
    										'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true, 'TITLE'),
    										'tab_content' => ''
    									);
    	return $tab_array ;
    }
    add_action('geodir_after_tab_content' ,'geodir_Feed_content');
    function geodir_Feed_content($tab_index)
    {
    	if($tab_index =='Feed')
    	{
    		echo do_shortcode( '[SHORTCODE]' );
    	}
    }
    ?>
Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket