Supreme Directory Theme FAQs

Supreme Directory Theme

To change the footer text in the Supreme or Directory Starter theme, add the following code to your functions.php file or as a code snippet if you are using the Code Snippet plugin:

add_action('after_setup_theme', '_my_sd_footer_changes',15); 
function _my_sd_footer_changes(){
	remove_action( 'dt_footer_copyright', 'dt_footer_copyright_default', 10 );
    remove_action( 'dt_footer_copyright', 'sd_footer_copyright_default', 10 );
    add_action( 'dt_footer_copyright', 'custom_dt_footer_copyright_text', 10 );
}

function custom_dt_footer_copyright_text(){
    echo '© 2018 Supreme Theme LLC. All Rights Reserved.';
}

Please log in to rate this.
30 people found this helpful.


Category: Directory Starter Theme, Supreme Directory Theme

← FAQs

Please log in to rate this.
30 people found this helpful. Permalink


This can be done two ways:

  1. Add the following CSS:
    .featured-area .geodir-category-list-in {display:none;}
  2. Edit the following file /wp-content/themes/supreme-directory/inc/geodirectory-compatibility.php
    Look for 

    echo do_shortcode('[gd_popular_post_category category_limit=5]');

    and comment or delete.

Please log in to rate this.
5 people found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
5 people found this helpful. Permalink


Change the default author page background image, as shown on this demo here: https://wpgeo.directory/supreme-directory/author/stiofan/

define('SD_DEFAULT_FEATURED_IMAGE', 'http://your image url here');

Please log in to rate this.
3 people found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
3 people found this helpful. Permalink


From: https://wpgeodirectory.com/support/topic/my-account-in-supreme-directory/

For the author page

add_filter('geodir_dashboard_links', 'dt_geodir_dashboard_links_custom');
function dt_geodir_dashboard_links_custom($dashboard_link) {
	if (!is_user_logged_in()) {
		return $dashboard_link;
	}
	$post_types = geodir_get_posttypes('object');

	$user_id = get_current_user_id();
	$author_link = get_author_posts_url($user_id);
	$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
	
	$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
	$user_listing = geodir_user_post_listing_count($user_id);
	$my_listings_link = false;

	$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
	$user_favourite = geodir_user_favourite_listing_count($user_id);
	$my_favorites_link = false;
	
	foreach ($post_types as $key => $postobj) {
		if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
			if (!$my_listings_link) {
				$listing_link = geodir_getlink($author_link, array('stype' => $key), false);

				$dashboard_link .= '<li>';
				$dashboard_link .= '<i class="fa fa-user"></i>';
				$dashboard_link .= '<a href="'.$listing_link.'">';
				$dashboard_link .= __('My Listings', 'gdbuddypress');
				$dashboard_link .= '</a>';
				$dashboard_link .= '</li>';

				$my_listings_link = true;
			}
		}
	}

	foreach ($post_types as $key => $postobj) {
		if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
			if (!$my_favorites_link) {
				$post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false);
				
				$dashboard_link .= '<li>';
				$dashboard_link .= '<i class="fa fa-user"></i>';
				$dashboard_link .= '<a href="'.$post_type_link.'">';
				$dashboard_link .= __('My Favorites', 'gdbuddypress');
				$dashboard_link .= '</a>';
				$dashboard_link .= '</li>';

				$my_favorites_link = true;
			}
		}
	}
	
	
	return $dashboard_link;
}

For the dashboard area

add_action('sd_my_account_logged_in_extras', 'dt_geodir_dashboard_links_custom');
function dt_geodir_dashboard_links_custom() {
	if (!is_user_logged_in()) {
		return;
	}

	$dashboard_link = '';
	$post_types = geodir_get_posttypes('object');

	$user_id = get_current_user_id();
	$author_link = get_author_posts_url($user_id);
	$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);

	$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
	$user_listing = geodir_user_post_listing_count($user_id);
	$my_listings_link = false;

	$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
	$user_favourite = geodir_user_favourite_listing_count($user_id);
	$my_favorites_link = false;

	foreach ($post_types as $key => $postobj) {
		if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
			if (!$my_listings_link) {
				$listing_link = geodir_getlink($author_link, array('stype' => $key), false);

				$dashboard_link .= '<li>';
				$dashboard_link .= '<i class="fa fa-user"></i>';
				$dashboard_link .= '<a href="'.$listing_link.'">';
				$dashboard_link .= __('My Listings', 'gdbuddypress');
				$dashboard_link .= '</a>';
				$dashboard_link .= '</li>';

				$my_listings_link = true;
			}
		}
	}

	foreach ($post_types as $key => $postobj) {
		if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
			if (!$my_favorites_link) {
				$post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false);

				$dashboard_link .= '<li>';
				$dashboard_link .= '<i class="fa fa-user"></i>';
				$dashboard_link .= '<a href="'.$post_type_link.'">';
				$dashboard_link .= __('My Favorites', 'gdbuddypress');
				$dashboard_link .= '</a>';
				$dashboard_link .= '</li>';

				$my_favorites_link = true;
			}
		}
	}

	echo $dashboard_link;
}

Please log in to rate this.
2 people found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
2 people found this helpful. Permalink


BlogSidebar

The blog in Supreme doesn’t have a sidebar by default, but you can turn one on for normal pages like blog pages at:
WordPress > Customizer > Body > Sidebar

Please log in to rate this.
0 people found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
0 people found this helpful. Permalink


The following are examples for developers to change the Detail and Author pages of the Supreme Directory child theme. For instructions about how to change styles or add snippets, please see our page on Customizing Your Style. For support with these examples, please contact a developer at the GD Experts Directory.

Add another service link with icon – Instagram example

At the top of the detail page are a collection of icons linked with URLs to the website or Facebook page of the listing.
This snippet will replace that section, and allow you to edit the order of the icons as well as adding a new icon with link. In this example we are adding a custom URL called ‘instagram’. The field’s html name is ‘instagram’ so add a prefix ‘geodir_’. There is also an optional portion at the end to show how to replace an icon with a different font-awesome icon.

add_filter('sd_details_output_social','_my_extra_social_details',10);
function _my_extra_social_details($output){
	global $post;

	if(isset($post->geodir_instagram) && $post->geodir_instagram){

if (strpos($output, 'fa-external-link-square') !== false) {
$output = str_replace('fa-external-link-square"></i></a>','fa-external-link-square"></i></a><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output);
}elseif (strpos($output, 'fa-facebook-official') !== false) {
$output = str_replace('fa-external-link-square"></i></a>','fa-facebook-official"></i></a><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output);
}elseif (strpos($output, 'fa-twitter-square') !== false) {
$output = str_replace('fa-external-link-square"></i></a>','fa-twitter-square"></i></a><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output);
}else{
$output = str_replace('<div class="sd-contacts">','<div class="sd-contacts"><a rel="nofollow" target="_blank" href="' . esc_url($post->geodir_instagram) . '"><i class="fa fa-instagram"></i></a>',$output);
}

// replace some icons
$output = str_replace('fa-facebook-official','fa-wordpress',$output);

	}
	return $output;
}

PHP for Mouseover for Category Icons

From: https://wpgeodirectory.com/support/topic/supreme-directory-category-icons/
PHP

add_filter('sd_details_output_cat_links', 'custom_sd_details_output_cat_links');
function custom_sd_details_output_cat_links($cat_links) {
	global $preview, $post;
	if (!$preview) {
		$post_type = $post->post_type;
		$post_tax = $post_type . "category";
		$post_cats = $post->{$post_tax};
	} else {
		$post_type = $post->listing_type;
		$post_tax = $post_type . "category";
		$post_cats = isset($post->post_category) ? $post->post_category[$post_tax] : $post->{$post_tax};
	}

	if (is_array($post_cats)) {
		$post_cats = implode(',', $post_cats);
	}

	$cats_arr = array_filter(explode(",", $post_cats));
	$cat_icons = geodir_get_term_icon();

	$cat_links = '<div class="sd-detail-cat-links"><ul>';
	foreach ($cats_arr as $cat) {
		$term_arr = get_term($cat, $post_tax);
		$term_icon = isset($cat_icons[$cat]) ? $cat_icons[$cat] : '';
		$term_url = get_term_link(intval($cat), $post_tax);
		$cat_links .=  '<li><a href="' . esc_url($term_url) . '" title="' . esc_attr($term_arr->name) . '"><img src="' . esc_url($term_icon) . '">';
		$cat_links .= '<span class="cat-link">' . esc_attr($term_arr->name) . '</span>';
		$cat_links .= '</a></li>';
	}
	$cat_links .= '</ul></div> <!-- sd-detail-cat-links end --> </div> <!-- sd-detail-info end -->';
	
	return $cat_links;
}

Change category icons on the detail page

This is a PHP Snippet customization that allows you to change out the icons on the detail page.

 = 'CATEGORY ICON URL';
         $terms_icons['946'] = 'http://mysite.com/wp-content/uploads/2018/01/my-other-icon.png';
    }
    return $terms_icons;
}
add_filter( 'geodir_get_term_icons', '_gd_custom_detail_page_category_icon', 10, 2 );

Alter the address at the top of the Supreme Directory detail page

Add this Snippet to add the complete address at the top of the detail page.
Read more here

add_filter('sd_details_output_address', 'modify_sd_details_output_address');
function modify_sd_details_output_address() {
    global $post;
    $sd_address = '<div class="sd-address">';
    if (isset($post->post_address) && $post->post_address) {
        $sd_address .= apply_filters('sd_detail_address', $post->post_address, $post);
    }
    if (isset($post->post_city) && $post->post_city) {
        $sd_address .= '<br/>' . apply_filters('sd_detail_city_name', $post->post_city, $post);
    }
    if (isset($post->post_region) && $post->post_region) {
        $sd_address .= ', ' . apply_filters('sd_detail_region_name', $post->post_region, $post);
    }
    if (isset($post->post_zip) && $post->post_zip) {
        $sd_address .= ', ' . apply_filters('sd_detail_zip', $post->post_zip, $post);
    }
    $sd_address .= '</div>';

    return $sd_address;
}

Add another send enquiry link

Add an additional ‘Send Enquiry’ link that you can style with your own custom CSS
Read more

<?php global $post; if ( ! empty( $post ) && ! empty( $post->geodir_email ) ) { ?>
    <a href="javascript:void(1);" class="b_send_inquiry2" onclick="jQuery('.b_send_inquiry').click();">Send Enquiry</a>
<?php } ?>

Hide the entire featured image area

CSS to hide the featured image from the top part of the page.

.sd.single.geodir-page .featured-area{
   display:none!important
}

Change the default featured image shown on new listings with a constant (add to wp-config.php).

define('SD_DEFAULT_FEATURED_IMAGE', "http://yourdomain.com/images/featured.jpg")

Hide the display of the word “Address” and “Phone” in sidebar but leave the icon in place

.geodir-sidebar-wrap .geodir-i-location,
.geodir-sidebar-wrap .geodir-i-contact { display:none; }

Change Category and Tag links to remove the Location Filter

Links for Categories and Tags on the Detail page will include the location of the listing. For example, the “Restaurant” Category at the top of the page will have a link that includes the location of the listing: https://MyGeodirectory.com/supportdemoalex/places/united-kingdom/northern-ireland/newcastle/restaurants/
Use the following snippet to make the link for Categories and Tags point to the base page like: https://MyGeoDirectory.com/supportdemoalex/places/restaurants/
The following Snippet will remove the filter that adds the location slugs to the URL on any page including Listing pages.

remove_filter('term_link', 'geodir_get_term_link', 10);

Modify breadcrumbs to point to GD Home instead of WP Front Page

function modify_breadcrumb_first_item($html) {
    return '<a href="' . home_url() . '/directory/">' . __( 'Directory', 'geodirectory' ) . '</a>';
}
add_filter('geodir_breadcrumb_first_link', 'modify_breadcrumb_first_item');

Move Detail Page Sidebar Widget Area to the Top of the Sidebar

This snippet will move the entire widget area to the top of the sidebar

remove_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_widget_area', 20);
add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_widget_area', 1);

Display tags on Detail Page

remove_action('geodir_before_detail_page_more_info','sd_tags_content');
add_action('sd_detail_before_cat_links','sd_tags_content');

Use this CSS to show the tags

.sd-detail-info .geodir_more_info { clear: both; }

Author Images and Author Page

Changes for the author image

Changes the default image used on the listing detail page and author page.

define('SD_DEFAULT_FEATURED_IMAGE', 'http://your image url here');

Hide the author image everywhere with CSS

.sd .sd-detail-author {display: none;}

Change every author image on the whole site to be the same

.author-avatar img{
    display:none!important
}
.author-avatar {
    background-image: url(&quot;https://wpgeodirectory.com/support/wp-content/uploads/2017/02/my_custom_author_image.png&quot;);
    background-repeat: no-repeat;
    background-size:  cover;
}

Change the default image by adding a constant to wp-config.php

define('SD_DEFAULT_GRAVATAR_IMAGE', 'http://your image url here');

Change only the default author image by replacing the image file on your server at: supreme-directory/images/gravatar2.png

Buddypress profile image

Display the BuddyPress profile image instead of the member account Gravatar as author image on Detail page
This snippet will switch out the usual display of the author’s gravatar for the image uploaded to the BuddyPress profile. This snippet is specifically for Supreme Directory and will only work with BuddyPress.

add_filter('sd_detail_entry_author','_my_change_sd_avatart_to_bp');
function _my_change_sd_avatart_to_bp($html){
    global $post;
    $author_id = $post->post_author;
    $avatarurl = bp_core_fetch_avatar( array( 'item_id' => $author_id, type => 'full', 'html' => true ) );
    if($avatarurl){$html = $avatarurl;}
    return $html;
}

Change the default author background (featured) image:

define('SD_DEFAULT_FEATURED_IMAGE', 'http://your image url here');

Remove the link on the Author Image to the Author Page

add_filter('geodir_reviewer_content_author_link', '__return_false');

Change the “Contact the Author”link into a “Send Enquiry” link that creates a BuddyPress Private Message.

function bp_custom_get_send_private_message_link($to_id,$subject=false,$message=false) {

	//if user is not logged, do not prepare the link
	if ( !is_user_logged_in() )
	return false;

	$compose_url=bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?';
	if($to_id)
	$compose_url.=('r=' . bp_core_get_username( $to_id ));
	if($subject)
	$compose_url.=('&subject='.$subject);
	if($message)
	$compose_url.=('&content='.$message);

	return wp_nonce_url( $compose_url ) ;
}
add_filter('b_send_inquiry_url', 'b_send_inquiry_url');
function b_send_inquiry_url() {
    global $post;
	$url = bp_custom_get_send_private_message_link($post->post_author);
	return $url;
}

My Account Area – Add links

add_action('sd_my_account_logged_in_extras', 'sd_my_account_logged_in_extras');
function sd_my_account_logged_in_extras() {
   ?>
<ul class="sd-my-account-dd-menu-group sd-my-account-dd-menu-bp-group">
                        <li class="sd-my-account-dd-menu-link">
                            <a href="#">
                                <i class="fa fa-user"></i> Link1
                            </a>
                        </li>
                        <li class="sd-my-account-dd-menu-link">
                            <a href="#">
                                <i class="fa fa-user"></i> Link2
                            </a>
                        </li>
                    </ul>
  <?php
}

My Account Area – Add favorites and listings inside the My Account area

add_action('sd_my_account_logged_in_extras', 'dt_geodir_dashboard_links_custom');
function dt_geodir_dashboard_links_custom() {
	if (!is_user_logged_in()) {
		return;
	}

	$dashboard_link = '';
	$post_types = geodir_get_posttypes('object');

	$user_id = get_current_user_id();
	$author_link = get_author_posts_url($user_id);
	$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);

	$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
	$user_listing = geodir_user_post_listing_count($user_id);
	$my_listings_link = false;

	$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
	$user_favourite = geodir_user_favourite_listing_count($user_id);
	$my_favorites_link = false;

	foreach ($post_types as $key => $postobj) {
		if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
			if (!$my_listings_link) {
				$listing_link = geodir_getlink($author_link, array('stype' => $key), false);

				$dashboard_link .= '<li>';
				$dashboard_link .= '<i class="fa fa-user"></i>';
				$dashboard_link .= '<a href="'.$listing_link.'">';
				$dashboard_link .= __('My Listings', 'gdbuddypress');
				$dashboard_link .= '</a>';
				$dashboard_link .= '</li>';

				$my_listings_link = true;
			}
		}
	}

	foreach ($post_types as $key => $postobj) {
		if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
			if (!$my_favorites_link) {
				$post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false);

				$dashboard_link .= '<li>';
				$dashboard_link .= '<i class="fa fa-user"></i>';
				$dashboard_link .= '<a href="'.$post_type_link.'">';
				$dashboard_link .= __('My Favorites', 'gdbuddypress');
				$dashboard_link .= '</a>';
				$dashboard_link .= '</li>';

				$my_favorites_link = true;
			}
		}
	}

	echo $dashboard_link;
}

Advance Search Filters always open

add_filter('sd_search_shortcode_args', 'modify_sd_search_shortcode_args');
function modify_sd_search_shortcode_args($args) {
      if (geodir_is_page('search')) {
         $args['show_adv_search'] = 'always';
	  }
      return $args;
}

Add a wrapper to OEmbeds to enable responsive video

add_filter( 'embed_oembed_html', 'geodir_oembed_filter', 10, 4 ) ;
function geodir_oembed_filter($html, $url, $attr, $post_ID) {
    $return = '<div class="geodir-video-wrapper">'.$html.'</div>';
    return $return;
}

Please log in to rate this.
1 person found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
1 person found this helpful. Permalink


CSS to Unhide the Listing Page Title H1

CSS

body.sd #geodir_content > header.entry-header {
display: block;
}

CSS to Unhide the Footer on the Search and Listings Pages

Supreme search and listings pages show the listings in a scroll area on the left with a fixed height to keep the page from scrolling. This requires hiding the footer. If you want to unhide the footer, you can do it with this CSS, but it may result in a scroll bar on the page.

.sd.search.geodir-page .site-footer, .sd.archive.geodir-page .site-footer {
    display: block!important;
}

Special Content for each Category (Listing) page

Visit your category and add your special content to the “Category Top Description”. Next, visit the listing page for the category and your special content will be displayed at the top of the listings section.

Special Content for each Location (Listing) page

Visit your “Default Location” or GD > Multilocations > Manage Locations and fill in the description of the place. The content will then be displayed at the top of the listings section on the location page.

Set the Hero/Parallax Featured Image for all Listing Pages

All category and location Listing and Archive pages are “Listings” pages, and they all use the same “Posts Page” page template. If you choose to set a featured image for the Listing page, you set that image on the “Posts Page” and then that same featured image will be the same for all categories and location pages.
There are two ways to set the image:
Method 1
– Create a page “123Home” and another called “XYZPosts”
– Visit WP > Settings > Reading > Your Homepage displays
– Set Home page to “123Home”
– Set Posts page to “XYZPosts”
– Go to the “XYZPOsts” page, and edit the page. Set the featured image.
– Done
Method 2
If the Posts page gas no featured image, you can add the following to wp-config.php:

if ( ! defined( 'SD_DEFAULT_FEATURED_IMAGE' ) ) {
    define( 'SD_DEFAULT_FEATURED_IMAGE', "https://MYSITE.com/uploads/2017/11/featured.jpg" );
}

Change Supreme Directory Listing Page Map Properties

In Supreme the listing page sidebar map is rendered via shortcode, so changes made to a widget will have no effect.

Instead you can use customize the following snippet with the shortcode parameters you want. Add following code snippets in your child theme functions.php file OR add it in via any snippet plugin.

function _gd_custom_supreme_listing_map_args( $args = array() ) {
    $args['maptype']                = 'TERRAIN';    // HYBRID, ROADMAP, SATELLITE, TERRAIN
    $args['zoom']                   = 14;           // number between 1 to 19
    $args['autozoom']               = true;         // true or false
    $args['scrollwheel']            = true;         // true or false
    $args['sticky']                 = true;         // true or false
    $args['enable_marker_cluster']  = true;         // true or false

    return $args;
}
add_filter ('geodir_map_options_gd_listing_map', '_gd_custom_supreme_listing_map_args', 10, 1 );

Remove the map from Supreme Listing pages

Remove from all listing pages:

.sd.post-type-archive.geodir-page #geodir_content {
    flex-basis: 100%;
    width: 100% !important;
}
.sd.archive.geodir-page .geodir-listings-sidebar-right {
    display: none;
}

Customize and target listing pages for each CPT by changing the name of the CPT in the CSS below:

.sd.post-type-archive-gd_place.geodir-page #geodir_content {
    flex-basis: 100%;
    width: 100% !important;
}
.sd.archive.geodir-page .geodir-listings-sidebar-right {
    display: none;}

Please log in to rate this.
1 person found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
1 person found this helpful. Permalink


CSS to add text after the home page search bar

CSS

.sd-homepage .geodir-search:after {
    content:"My Custom Text";
    color:#fff!important;
    width: 100%!important;
}

Adjust Popular Categories to show parent categories only

There are no options for adjusting the Popular Categories shortcode on the Home and Location pages, but there is a way to customize it.
Changes will be overwritten if the theme is updated.
To show parent categories only, edit the following file: Edit the following file /wp-content/themes/supreme-directory/inc/geodirectory-compatibility.php on line #1116

echo do_shortcode('[gd_popular_post_category category_limit=5]');

and change it to

echo do_shortcode('[gd_popular_post_category category_limit=5 parent_only=true]');

Please log in to rate this.
0 people found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
0 people found this helpful. Permalink


WordPress Pages (not posts, or GD posts, but WordPress Pages) can be made full width with the following CSS:

.sd .container div.entry-content {
    margin:0px!important;
    padding:0px!important;    
}

.page-template-page_full-width .container {
    width: 100%;
    padding:0px!important;
}

Please log in to rate this.
0 people found this helpful.


Category: Supreme Directory Theme

← FAQs

Please log in to rate this.
0 people found this helpful. Permalink