Supreme (v1) 'Claim Listing ' shortcode or widget required if possible.

This topic contains 18 replies, has 4 voices, and was last updated by  Kiran 3 months, 1 week ago.

  • Author
  • #496774

    Post count: 14176

    Hi Ian,

    Thanks for your reply. The code from the Github link is not working on this post . I will ask a developer about this and will come back to you soonest.



    Post count: 5719

    Hello Ian,

    Please try following PHP snippet.

    //usage editor: [gd_claim_link class="" icon="false"]
    //usage php: echo do_shortcode('[gd_claim_link class="" icon="false"]');
    function geodir_claim_link_sc($atts) {
        if (function_exists('geodir_load_translation_geodirclaim')) {
            global $post, $preview;
            $defaults = array(
                'class' => 'supreme-btn supreme-btn-small supreme-edit-btn',
                'icon' => "true",
                'link_text' => __('Claim', 'directory-starter')
            $params = shortcode_atts($defaults, $atts);
            $geodir_post_type = array();
            if (get_option('geodir_post_types_claim_listing'))
                $geodir_post_type = get_option('geodir_post_types_claim_listing');
            $posttype = (isset($post->post_type)) ? $post->post_type : '';
            if (in_array($posttype, $geodir_post_type) && !$preview) {
                $is_owned = absint(geodir_get_post_meta($post->ID, 'claimed', true));
                if (get_option('geodir_claim_enable') == 'yes' && empty($is_owned)) {
                    if (is_user_logged_in()) {
                        echo '<div class="geodir-company_info" style="border: none;margin: 0;padding: 0">';
                        echo '<div class="geodir_display_claim_popup_forms"></div>';
                        echo '<a href="javascript:void(0);" class="'.$params['class'].' geodir_claim_enable">';
                        if ($params['icon'] == 'true') {
                            echo '<i class="fa fa-question-circle"></i>';
                        echo $params['link_text'];
                        echo '</a>';
                        echo '</div>';
                        echo '<input type="hidden" name="geodir_claim_popup_post_id" value="' . $post->ID . '" />';
                    } else {
                        $site_login_url = geodir_login_url();
                        echo '<a href="' . $site_login_url . '" class="'.$params['class'].'">';
                        if ($params['icon'] == 'true') {
                            echo '<i class="fa fa-question-circle"></i>';
                        echo $params['link_text'];
                        echo '</a>';
            $output = ob_get_contents();
            return $output;
    add_shortcode('gd_claim_link', 'geodir_claim_link_sc');

    Add above code via PHP snippet plugin or add in parent theme/child theme functions.php file.

    Use shortcode

    [gd_claim_link class="" icon="false"]

    to show claim link with text.



    Full Member
    Post count: 138

    Hi Kiran.

    Wow thank you so very much for that huge effort, i really appreciate it, amazing!

    Just added the code and the shortcode to the sidebar and it works 100% perfect ! 🙂

    Thank you once again you are a legend !!!

    Kindest regards,



    Post count: 5719
    This reply has been marked as private.
Viewing 4 posts - 16 through 19 (of 19 total)

The topic ‘Supreme (v1) 'Claim Listing ' shortcode or widget required if possible.’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.