Results 1 to 1 of 1

Thread: Favorite Ads V 1.3

  1. #1
    Thread Starter
    justmotors's Avatar
    Join Date
    Mar 2014
    Location
    Ireland
    Posts
    333
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Favorite Ads V 1.3

    Hi !

    Im running version 1.3, after switching themes I just cant seem to get the plugin to work.

    I have posted this in the page: {{cp-favorite-posts}}

    I have been trying to get the following working in the single ad listing page: <?php if (function_exists('cpfp_link')) { cpfp_link(); } ?>

    I just cant seem to get it working anywhere I paste the code in the single ad listing:



    <?php
    /**
    * The Template for displaying all single ads.
    *
    * @package ClassiPress\Templates
    * @author AppThemes
    * @since ClassiPress 3.0
    */
    ?>


    <script type="text/javascript">
    jQuery(document).ready(function($) {

    $('.owl-carousel').owlCarousel({
    loop: false,
    rtl: false,
    dots: true,
    dotsData:true,
    nav: false,
    autoplay:false,
    autoplayTimeout:4000,
    autoplayHoverPause:true,
    animateOut: 'fadeOut',
    items: 1,
    });

    $( '.owl-stage' ).lightGallery({
    selectWithin : '.owl-item',
    selector : '.ad-thumb',
    startClass : 'lg-start-zoom',
    download : false,
    loop : false,
    exThumbImage : 'data-thumb',
    thumbWidth : 75,
    thumbContHeight : 75,
    getCaptionFromTitleOrAlt : false,
    hideControlOnEnd : true,
    hideBarsDelay : 1000,
    });

    });
    </script>

    <div class="container">

    <div class="row">

    <div id="breadcrumb" class="col-md-12"><?php cp_breadcrumb(); ?></div>

    <div class="clr"></div>

    <div class="cleft col-md-8">

    <?php do_action( 'appthemes_notices' ); ?>

    <?php appthemes_before_loop(); ?>

    <?php if ( have_posts() ) : ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php appthemes_before_post(); ?>

    <?php appthemes_stats_update( $post->ID ); //records the page hit ?>

    <div class="shadowblock_out <?php cp_display_style( 'featured' ); ?>">

    <div class="shadowblock">

    <?php appthemes_before_post_title(); ?>

    <h1 class="single-listing"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>

    <div class="clr"></div>

    <?php appthemes_after_post_title(); ?>

    <div class="pad5 dotted"></div>

    <div class="owl-carousel owl-theme ad-main-image">

    <?php cp_get_image_url_single( $post->ID, 'ad-large', $post->post_title ); ?>



    </div>

    <div class="bigright <?php cp_display_style( 'ad_single_images' ); ?>">

    <ul class="two-cols">

    <?php
    // grab the category id for the functions below
    $cat_id = appthemes_get_custom_taxonomy( $post->ID, APP_TAX_CAT, 'term_id' );

    if ( get_post_meta( $post->ID, 'cp_ad_sold', true ) === 'yes' ):
    ?>
    <li id="cp_sold" class="icon-pulse"><span><?php _e( 'This item has been sold', APP_TD ); ?></span></li>
    <?php endif; ?>

    <li id="cp_listed"><span><?php _e( 'Listed:', APP_TD ); ?></span> <?php echo appthemes_display_date( $post->post_date ); ?></li>
    <?php if ( $expire_date = get_post_meta( $post->ID, 'cp_sys_expire_date', true ) ): ?>
    <li id="cp_expires"><span><?php _e( 'Expires:', APP_TD ); ?></span> <?php echo cp_timeleft( $expire_date ); ?></li>
    <?php endif; ?>

    <?php
    // 3.0+ display the custom fields instead (but not text areas)
    cp_get_ad_details( $post->ID, $cat_id );
    ?>

    </ul>

    </div><!-- /bigright -->

    </div><!-- /shadowblock -->

    </div><!-- /shadowblock_out -->

    <?php if ( $cp_options->ad_images ): ?>

    <?php endif; ?>

    <div class="clr"></div>

    <?php appthemes_before_post_content(); ?>

    <?php
    global $gmap_active;

    // make sure google maps has a valid address field before showing tab
    $gmap_active = false;
    $location_fields = get_post_custom();
    $_fields = array( 'cp_zipcode', 'cp_country', 'cp_state', 'cp_street', 'cp_city' );
    foreach ( $_fields as $i ) {
    if ( ! empty( $location_fields[$i] ) && ! empty( $location_fields[$i][0] ) ) {
    $gmap_active = true;
    break;
    }
    }

    ?>
    <ul id="tabby-single-ad_listing" class="nav nav-tabs nav-justified">

    <li><a href="#description" data-toggle="tab"><i class="fa fa-file-text-o fa-lg"></i> <?php _e( 'Description', 'classipost' ); ?></a></li>
    <?php if ( $gmap_active && (of_get_option('remove_maps', of_get_default('remove_maps')) == '0') ) { ?><li><a href="#location" data-toggle="tab"><i class="fa fa-map-marker fa-lg"></i> <?php _e( 'Location', 'classipost' ); ?></a></li><?php } ?>
    <?php if( comments_open() ) { ?><li><a href="#comments" data-toggle="tab"><i class="fa fa-comments fa-lg"></i> <?php _e( 'Comments', 'classipost' ); ?></a></li><?php } ?>
    <li><a href="#related-items" data-toggle="tab"><i class="fa fa-files-o fa-lg"></i> <?php _e( 'Related Ads', 'classipost' ); ?></a></li>
    </ul>


    <div id="single-ad-tabs" class="tab-content">




    <div class="tab-pane fade item-description" id="description">

    <div class="shadowblock_out">

    <div class="shadowblock">

    <div class="single-main">

    <?php
    // 3.0+ display text areas in content area before content.
    cp_get_ad_details( $post->ID, $cat_id, 'content' );
    ?>

    <h3 class="description-area"><?php _e( 'Description', APP_TD ); ?></h3>

    <?php the_content(); ?>

    </div>

    <?php appthemes_after_post_content(); ?>


    <?php appthemes_after_post(); ?>

    <?php endwhile; ?>

    <?php appthemes_after_endwhile(); ?>

    <?php else: ?>

    <?php appthemes_loop_else(); ?>

    <?php endif; ?>

    <div class="clr"></div>

    <?php appthemes_after_loop(); ?>

    <?php wp_reset_query(); ?>

    </div><!-- /description -->

    </div><!-- /shadowblock -->

    </div><!-- /shadowblock_out -->

    <?php if ( $gmap_active && (of_get_option('remove_maps', of_get_default('remove_maps')) == '0') ) { ?>

    <div class="tab-pane item-description fade" id="location">

    <div class="shadowblock_out">

    <div class="shadowblock">

    <?php get_template_part( 'includes/sidebar', 'gmap' ); ?>

    </div>

    </div>

    </div><!-- /location -->

    <?php } ?>

    <?php if( comments_open() ) { ?>

    <div class="tab-pane fade" id="comments">

    <?php comments_template( '/comments-ad_listing.php' ); ?>

    </div><!-- /comments -->

    <?php } ?>

    <div class="tab-pane fade" id="related-items">

    <div class="shadowblock_out hidden-ms hidden-xs">
    <div class="shadowblock">
    <div class="listing-layout">
    <div class="pull-right">
    <?php _e( 'View type:', 'classipost' ); ?>
    <button type="button" id="listview" class="list btn btn-default btn-sm"><i class="fa fa-bars fa-fw fa-lg" aria-hidden="true"></i></button>
    <button type="button" id="gridview" class="grid btn btn-default btn-sm"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i></button>
    </div>
    </div>
    </div>
    </div>

    <?php appthemes_before_loop(); ?>

    <?php
    $terms = get_the_terms( $post->ID , 'ad_cat', 'string');
    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    $do_not_duplicate[] = $post->ID;

    if(!empty($terms)){
    foreach ($terms as $term) {
    query_posts( array(
    'ad_cat' => $term->slug,
    'showposts' => 6,
    'paged' => $paged,
    'ignore_sticky_posts' => 1,
    'post__not_in' => $do_not_duplicate,
    'orderby' => 'rand',));
    ?>

    <?php if ( have_posts() ) : ?>

    <div class="loop-items row row-eq-height no-gutter">

    <?php while ( have_posts() ) : the_post();
    $do_not_duplicate[] = $post->ID;
    ?>

    <?php appthemes_before_post(); ?>

    <?php get_template_part( 'content', APP_POST_TYPE ); ?>

    <?php appthemes_after_post(); ?>

    <?php endwhile; ?>

    </div>

    <?php //appthemes_after_endwhile(); ?>

    <?php else: ?>

    <?php appthemes_loop_else(); ?>

    <?php endif; ?>

    <?php //appthemes_after_loop(); ?>
    <?php
    }
    }

    ?>
    <?php wp_reset_query(); ?>

    </div><!-- /related_ads -->

    </div><!--/tab_content -->

    <div class="pull-left"><?php previous_post_link( '%link', '%title <i class="fa fa-arrow-circle-left" aria-hidden="true"></i>', TRUE, '', APP_TAX_CAT ); ?></div> <div class="pull-right"><?php next_post_link( '%link', '<i class="fa fa-arrow-circle-right" aria-hidden="true"></i> %title', TRUE, '', APP_TAX_CAT ); ?> </div>


    </div><!-- /content_left -->

    <?php get_sidebar( 'ad' ); ?>

    <div class="clr"></div>

    </div><!-- /content row -->




    </div><!-- /content container -->

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Favorite Ads Settings and bug
    By guyfrances in forum Favorite Ads
    Replies: 1
    Last Post: April 29th, 2017, 01:36 AM
  2. Favorite ads
    By acheica in forum Favorite Ads
    Replies: 0
    Last Post: January 23rd, 2017, 06:43 PM
  3. /my-favorite-ads is broken
    By anhquan in forum Favorite Ads
    Replies: 4
    Last Post: November 19th, 2015, 01:45 AM
  4. add to favorite
    By sonnycool in forum ClassiPress General Discussion
    Replies: 3
    Last Post: August 5th, 2014, 06:41 AM