hooks in div.sd-detail-details
This topic contains 6 replies, has 3 voices, and was last updated by Giri 7 years, 5 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: hooks
-
AuthorPosts
-
June 13, 2017 at 3:01 pm #383003
Are there any hooks available for “div.sd-detail-info” and “div.sd-detail-cta” on the detail page of supreme?
June 13, 2017 at 5:42 pm #383044Hi,
I alerted the developers to have a look at your question and let you know asap.
Thanks
June 14, 2017 at 10:38 am #383134There is a hook named
sd_detail_before_cat_links
available in the section you mentioned.
If you explain what you are trying to achieve, i can help you better.
Thanks
June 14, 2017 at 12:50 pm #383158Hi Giri,
The hook you mention is what I was looking for in the first div… thank you! Placed “Get Directions” under the address, here is what I used…
function geodirectory_detail_page_google_map_link() {
global $post, $preview;if ( !$preview && !empty( $post->post_latitude ) && !empty( $post->post_longitude ) ) {
$maps_url = add_query_arg( array(
‘q’ => $post->post_latitude . ‘,’ . $post->post_longitude,
), ‘http://maps.google.com/’ );
?>
<p><i class=”fa fa-location-arrow “></i> : ” target=”_blank”><?php echo __( ‘Get Directions’, ‘geodirectory’ ); ?></p>
<?php
}
}
add_action( ‘sd_detail_before_cat_links’, ‘geodirectory_detail_page_google_map_link’);For div “div.sd-detail-cta”, I would like to move the “write a review, send to friend, favorite and social links” to the bottom of the detail sidebar just for mobile devices. The goal is to move the profile accordion feature up so it is under the categories and move the social linking stuff down to the bottom for mobile devices or whenever the accordion is active. I’m in the process of trying to understand the use of hooks so hopefully this makes sense.
Thanks!
MikeJune 14, 2017 at 1:05 pm #383159Hi mrv,
That is not possible directly.
You need to have two copies of cta div.
One as it is right now, another one in the sidebar bottom.
You need to hide the sidebar one on desktops and main one on mobile.
You need to use css to hide them.
Hope that makes sense.
Use this code to add the cta in sidebar.
add_action('geodir_sidebar_detail_bottom_section', 'sd_sidebar_cta'); function sd_sidebar_cta() { global $preview, $post; echo '<div class="sd-detail-cta sd-detail-sidebar-cta">'; $review_button = '<a class="dt-btn" href="' . get_the_permalink() . '#reviews">' . __('Write a Review', 'supreme-directory') . '</a>'; echo apply_filters('sd_details_output_review_button',$review_button); $send_buttons = '<div class="geodir_more_info geodir-company_info geodir_email" style="padding: 0;border: none">'; if (!$preview) { $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /> <div class="geodir_display_popup_forms"></div>'; $send_buttons .= $html; } $send_buttons .= '<span style="" class="geodir-i-email">'; $send_buttons .= '<i class="fa fa-envelope"></i>'; if (isset($post->geodir_email) && $post->geodir_email) { $send_buttons .= '<a href="javascript:void(0);" class="b_send_inquiry">'.SEND_INQUIRY.'</a> | '; } $send_buttons .= '<a class="b_sendtofriend" href="javascript:void(0);">'.SEND_TO_FRIEND.'</a></span>'; $send_buttons .= '</div>'; echo apply_filters('sd_details_output_send_buttons',$send_buttons); ob_start(); geodir_favourite_html($post->post_author, $post->ID); $fav_html = ob_get_clean(); echo apply_filters('sd_details_output_fav',$fav_html); ob_start(); ?> <ul class="sd-cta-favsandshare"> <?php if (!$preview) { ?> <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Facebook', 'supreme-directory'); ?>" href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>"><i class="fa fa-facebook"></i></a></li> <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Twitter', 'supreme-directory'); ?>" href="http://twitter.com/share?text=<?php echo urlencode(get_the_title()); ?>&url=<?php echo urlencode(get_the_permalink()); ?>"><i class="fa fa-twitter"></i></a></li> <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Google Plus', 'supreme-directory'); ?>" href="https://plus.google.com/share?url=<?php echo urlencode(get_the_permalink()); ?>"><i class="fa fa-google-plus"></i></a></li> <?php } else { ?> <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Facebook', 'supreme-directory'); ?>" href=""><i class="fa fa-facebook"></i></a></li> <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Twitter', 'supreme-directory'); ?>" href=""><i class="fa fa-twitter"></i></a></li> <li><a rel="nofollow" target="_blank" title="<?php echo __('Share on Google Plus', 'supreme-directory'); ?>" href=""><i class="fa fa-google-plus"></i></a></li> <?php } ?> </ul> <?php $share_html = ob_get_clean(); echo apply_filters('sd_details_output_share_links',$share_html); echo '</div><!-- sd-detail-cta end -->'; ?> <?php }
Then use CSS media queries to hide.
Thanks
June 14, 2017 at 4:42 pm #383230Giri,
I came up with this, seems to work and looks logical…
@media (min-width: 0px) and (max-width: 600px) {
.sd-detail-cta { display: none; } /* show it on small screens */
}@media (min-width: 601px) and (max-width: 2000px) {
.sd-detail-cta { display: block; } /* show it on large screens */
}@media (min-width: 0px) and (max-width: 601px) {
.sd-detail-cta.sd-detail-sidebar-cta { display: block; } /* show it on small screens */
}@media (min-width: 600px) and (max-width: 2000px) {
.sd-detail-cta.sd-detail-sidebar-cta { display: none; } /* show it on large screens */
}Thank you for the help… greatly appreciated!!
MikeJune 15, 2017 at 11:01 am #383350You are welcome
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket