Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AyeCode/supreme-directory
Browse files Browse the repository at this point in the history
  • Loading branch information
1naveengiri committed Aug 23, 2019
2 parents 1da52a2 + 103b3a8 commit 1c84586
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 652 deletions.
41 changes: 0 additions & 41 deletions change_log.txt

This file was deleted.

76 changes: 38 additions & 38 deletions content-featured-area.php
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
<?php
if (((function_exists('is_buddypress') && !is_buddypress()) || !function_exists('is_buddypress')) && !get_post_meta($post->ID,'sd_remove_head',true)) {
global $post;
if(empty($pfp_post)){
$pfp_post = $post;
}
if ( ( ( function_exists( 'is_buddypress' ) && ! is_buddypress() ) || ! function_exists( 'is_buddypress' ) ) && ! get_post_meta( $pfp_post->ID, 'sd_remove_head', true ) ) {

$post_id = $post->ID;

$pid = $pfp_post->ID;
$featured_image = '';
if(function_exists('geodir_is_page') && geodir_is_page('single') && isset($post->post_type)){
$page_id = geodir_cpt_template_page('page_details',$post->post_type);
if($page_id){
$post_id = $page_id;
if ( function_exists( 'geodir_is_page' ) && geodir_is_page( 'single' ) && isset( $pfp_post->post_type ) ) {
$page_id = geodir_cpt_template_page( 'page_details', $pfp_post->post_type );
if ( $page_id ) {
$pid = $page_id;
}
}

$featured_type = get_post_meta($post_id, '_sd_featured_area', true);
if(empty($featured_type)){
$featured_type = get_post_meta( $pid, '_sd_featured_area', true );
if ( empty( $featured_type ) ) {

if(function_exists('geodir_is_page') && geodir_is_page('location')){
if ( function_exists( 'geodir_is_page' ) && geodir_is_page( 'location' ) ) {
$featured_type = 'location';

}elseif(is_front_page()){
} elseif ( is_front_page() ) {
$featured_type = 'location';
}else{
} else {
$featured_type = 'parallax';

}

}
if($featured_type=='remove'){ return;}
if ( $featured_type == 'remove' || ( function_exists('is_product_category') && is_product_category() ) ) {
return;
}

?>
<header>

<div class="featured-area type-<?php echo esc_attr($featured_type);?>">
<div class="featured-area type-<?php echo esc_attr( $featured_type ); ?>">

<?php if($featured_type=='parallax' || $featured_type=='location'){
<?php if ( $featured_type == 'parallax' || $featured_type == 'location' ) {
?>
<div id="sd-featured-img" class="featured-img" <?php
$featured_image = apply_filters('sd_featured_image','');

if($featured_image){
// do nothing
}
elseif (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it.
$full_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$featured_image = $full_image_url[0];
}else{
$featured_image = SD_DEFAULT_FEATURED_IMAGE;
}


?> style="background-image: url('<?php //echo esc_url($featured_image); ?>');" <?php
?>>
</div>
<div id="sd-featured-img" class="featured-img" <?php
$featured_image = apply_filters( 'sd_featured_image', '' );

if (!$featured_image && has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
$full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
$featured_image = $full_image_url[0];
} else {
$featured_image = SD_DEFAULT_FEATURED_IMAGE;
}
?>>
</div>
<?php
}?>
} ?>

<script>
(function(){
(function () {
var img = new Image(),
x = document.getElementById('sd-featured-img');

img.onload = function() {
x.style.backgroundImage = "url('"+img.src+"')";
img.onload = function () {
x.style.backgroundImage = "url('" + img.src + "')";
x.classList.add("sd-fade-in");
};

img.src = "<?php echo esc_url($featured_image); ?>";
img.src = "<?php echo esc_url( $featured_image ); ?>";
})();
</script>


<div class="header-wrap">
<?php

do_action('sd_feature_area');
do_action( 'sd_feature_area' );

?>
</div>
Expand Down
8 changes: 3 additions & 5 deletions content-geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,20 @@
<?php

// add the title if its not added in the featured area
$post_id = $post->ID;
$pid = $post->ID;
if(function_exists('geodir_is_page') && geodir_is_page('single') && isset($post->post_type)){
$page_id = geodir_cpt_template_page('page_details',$post->post_type);
if($page_id){
$post_id = $page_id;
$pid = $page_id;
}
}
$featured_type = get_post_meta($post_id, '_sd_featured_area', true);
$featured_type = get_post_meta($pid, '_sd_featured_area', true);
if($featured_type == 'remove'){
?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php
}

global $more;
$more = 0;
if (is_singular() || ( function_exists('is_bbpress') && is_bbpress() )) {
the_content();
} else {
Expand Down
4 changes: 1 addition & 3 deletions content.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php
}

global $more;
$more = 0;

if (is_singular() || ( function_exists('is_bbpress') && is_bbpress() )) {
the_content();
} else {
Expand Down
8 changes: 6 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Define some constants for later use.
*/
if (!defined('SD_DEFAULT_FEATURED_IMAGE')) define('SD_DEFAULT_FEATURED_IMAGE', get_stylesheet_directory_uri() . "/images/featured.jpg");
if (!defined('SD_VERSION')) define('SD_VERSION', "2.0.0.8");
if (!defined('SD_VERSION')) define('SD_VERSION', "2.0.0.9");
if (!defined('SD_CHILD')) define('SD_CHILD', 'supreme-directory');

if(is_admin()){
Expand Down Expand Up @@ -114,7 +114,7 @@ function sd_theme_customize_css() {
}

/**
* Loads the translation files for wordpress.
* Loads the translation files for WordPress.
*
* @since 1.0.0
*/
Expand Down Expand Up @@ -427,6 +427,10 @@ function sd_feature_area_title_meta(){
?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php
} elseif (function_exists('is_woocommerce') && is_woocommerce()) {
?>
<h1 class="entry-title"><?php woocommerce_page_title(); ?></h1>
<?php
} else if ( is_search() ) {
?>
<h1 class="entry-title"><?php echo apply_filters( 'sd_featured_area_search_page_title', sprintf( __( 'Search Results for: %s', 'supreme-directory' ), '<span>' . get_search_query() . '</span>' ) ); ?></h1>
Expand Down
Loading

0 comments on commit 1c84586

Please sign in to comment.