Move CPT

This topic contains 14 replies, has 3 voices, and was last updated by  Giri 7 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #381755

    Jay Kanabar
    Expired Member
    Post count: 166

    Is there any way I can move the CPT Listing below the Advanced Search (See image)?

    Jay

    #381801

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’m not sure there is an hook to do that, otherwise you need to modify theme files and that means losing the mod after every update and having to apply it again.

    I asked to the developers to let us know,

    Thanks

    #381836

    Jay Kanabar
    Expired Member
    Post count: 166

    I guess by “hook”, you mean an add on?
    This would be a better solution if there is one.

    #381896

    Giri
    Expired Member
    Post count: 3155

    Hi,

    By mean “Hook”, paolo meant the snippet.
    Please use code snippets plugin to add the following snippet.

    https://wordpress.org/plugins/code-snippets/

    
    
    remove_action('sd_homepage_content','sd_homepage_featured_content');
    function sd_homepage_featured_content_modified() {
        if (is_singular() && geodir_is_page('location') && $location = sd_gd_current_location_name() ) { ?>
            <h1 class="entry-title"><?php echo esc_attr(__($location, 'geodirectory')); ?></h1>
        <?php } else { ?>
            <h1 class="entry-title"><?php the_title(); ?></h1>
        <?php }
    
        $sub_title = get_post_meta(get_the_ID(), 'subtitle', true);
    
        if (geodir_is_page('location') && defined('GEODIRLOCATION_VERSION')) {
            $loc = geodir_get_current_location_terms();
            $location_type = geodir_what_is_current_location();
            $country_slug = '';
            $region_slug = '';
            if ($location_type == 'city') {
                $slug = $loc['gd_city'];
                $region_slug = isset($loc['gd_region']) ? $loc['gd_region'] : '';
                $country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : '';
            } else if ($location_type == 'region') {
                $slug = $loc['gd_region'];
                $country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : '';
            } elseif($location_type == 'country') {
                $slug = $loc['gd_country'];
                $country_slug = isset($loc['gd_country']) ? $loc['gd_country'] : '';
            }
            else {
                $slug = '';
            }
            $seo = geodir_location_seo_by_slug($slug, $location_type, $country_slug, $region_slug);
            $tagline = (isset($seo->seo_image_tagline)) ? __($seo->seo_image_tagline, 'geodirlocation') : '';
            if ($tagline) {
                $sub_title = stripslashes($tagline);
            }
    
        }
        if (isset($sub_title)) {
            echo '<div class="entry-subtitle">' . $sub_title . '</div>';
        }
    
        sd_search_form_shortcode();
        echo do_shortcode('[gd_cpt_listings cpt_img_width=120 cpt_img_height=90]');
    
        echo '<div class="home-more" id="sd-home-scroll"><a href="#sd-home-scroll" ><i class="fa fa-chevron-down"></i></a></div>';
    }
    add_action('sd_homepage_content','sd_homepage_featured_content_modified');

    Thanks

    PS: Make sure to activate the snippet.

    #383127

    Jay Kanabar
    Expired Member
    Post count: 166

    Hi Giri,

    Thank you for that snippet which worked to quite an extent. And I appreciate some modifications are required but if I try to comment out even the slightest then the whole snippet is removed.

    Please the attached screenshot without any mods.

    You will note the search box, entry title etc are duplicated. Also, the CPT listing is duplicated but keeps the Event CPT which I have excluded.

    Appreciate your help.
    Jay

    #383130

    Jay Kanabar
    Expired Member
    Post count: 166
    This reply has been marked as private.
    #383131

    Giri
    Expired Member
    Post count: 3155

    Hi Jay,

    To hide those duplicated content, you need to use CSS.

    Give me the link to the page where you took that screenshot.

    Thanks

    #383136

    Jay Kanabar
    Expired Member
    Post count: 166

    Hi Giri,

    http://lovefortennis.co.uk/

    the home page – sorry missed this.

    Thanks for prompt response.
    Jay

    #383143

    Giri
    Expired Member
    Post count: 3155
    This reply has been marked as private.
    #383149

    Jay Kanabar
    Expired Member
    Post count: 166

    Almost Giri,

    The CPT icons to be below the Search box but without the “Events” CPT (Same as in the Home Top Section). I will remove the this top Section GD CPT listing once the snippet is designed.

    The “GD Listing” title to be removed/hidden.

    I presume this is all in CSS and this will not be lost on upgrades?
    Jay

    #383154

    Giri
    Expired Member
    Post count: 3155

    Hi Jay,

    I have modified the snippet.

    CPT grids now get displayed below search form.

    But for some reason the css changes not reflecting in front end. Make sure you are not using any cache plugin.

    Thanks

    #383205

    Jay Kanabar
    Expired Member
    Post count: 166

    I am not using any Cache Plugin.
    I am not sure what I should be looking for. The CSS in the Script Tab is hiding the “Entry-Title” and the “Category List” correctly.
    I had previously inserted Additional CSS in the “supreme Directory” for the entry-title and the subtitle. Should I have put this in the GeoDirectory>Design>Script? So that the Titles goes with any other theme?

    The 2 improvements required:
    1. Events CPT not show.
    2. GD Listing label not to show.

    Thanking U
    Jay

    #383354

    Giri
    Expired Member
    Post count: 3155

    Hi Jay,

    I added this code in custom css. It works fine now.

    
    
    
    .header-wrap .geodir_cpt_listings h3.widget-title { display: none !important; }
    .header-wrap .geodir_cpt_listings .gd-cpt-wrow-gd_event { display: none !important; }
    #383861

    Jay Kanabar
    Expired Member
    Post count: 166

    Thanks Giri. This is resolved but see the Cache issue which you commented
    “But for some reason the css changes not reflecting in front end. Make sure you are not using any cache plugin.”
    I not using any cache plugin but the only way I am able to refresh the front page correctly is by temporarily selecting a different template before selecting the Supreme Dir Template again. Any permanent solution.
    Jay

    #383881

    Giri
    Expired Member
    Post count: 3155

    Hi Jay,

    If you are not using any cache plugin, but face those issues then the problem is with your hosting provider. Contact your hosting support.

    Thanks

Viewing 15 posts - 1 through 15 (of 15 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount