• Resolved tchatz

    (@tchatz)


    Hello, I have this problem with your plugin. My loop is:

    <article class=”row big-block <?php echo $this->get_no_thumb_class();?> entry-post block-post” <?php echo $this->get_item_scope();?>>

    <header class=”span8 fluid-offset-none nolinks”>

    <?php if (get_post_format($this->post->ID) == ‘video’) {
    echo ‘<div class=”flag-label”><span class=”flag-style fCaps fS10 blue-flag”>‘ . get_post_format_string( get_post_format() ) .’</span></div>’;

    } elseif (get_post_format($this->post->ID) == ‘gallery’) {
    echo ‘<div class=”flag-label”><span class=”flag-style fCaps fS10 red-flag”>‘ . get_post_format_string( get_post_format() ) .’</span></div>’;

    } else {
    echo ”;
    }
    ?>

    <div class=”tax fCaps”><?php
    $category = get_the_category();
    echo ‘<span itemprop=”articleSection”>cat_ID).'” title=”Δες όλα τα άρθρα στη κατηγορία ‘ . $category[0]->cat_name . ‘” rel=”category tag”>’ . $category[0]->cat_name . ‘</span>’;
    ?></div>

    <div class=”block-title”><?php echo $this->get_title(td_util::get_option(‘tds_mod9_title_excerpt’));?></div>

    </header>

    <div class=”span8 block-wrap fluid-offset-none clearfix”>

    <?php echo $this->get_image(‘art-big-1col’);?>

    <div class=”block-content”>

    <div class=”block-excerpt”><p class=”credit fCaps fNorm fS10″><?php echo $this->get_date();?></p><div itemprop=”articleBody”><p><?php echo $this->get_excerpt(td_util::get_option(‘tds_mod9_content_excerpt’));?></p></div></div>

    <div class=”meta meta-read-more fCaps fLS0 visible-desktop”>
    href;?>”><?php echo __td(‘Διάβασε περισσότερα’, TD_THEME_NAME);?>
    <?php echo $this->get_commentsAndViews();?>
    </div>

    <div class=”cat-share-post”><ul id=”social-tab” class=”social-tab social-sharebox social-init visible-desktop”><?php echo do_shortcode (‘[ultimatesocial networks=”facebook, twitter, google” count=”true” custom_class=”social-sharebox” native=”true”]’) ?></div>

    </div>

    </div>

    </article>

    The problem is that ajax lode more does not recognize $this. Could you please tell me that I have to do? Thank you in advance

    https://wordpress.org/plugins/ajax-load-more/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    You might need to make $this a global php variable… Yes, you are right that Ajax Load More likely does not know what $this is.

    Thread Starter tchatz

    (@tchatz)

    Unfortunately, I am not the creator of this theme, so I don’t know what is $this, but I will try to find out

    Thread Starter tchatz

    (@tchatz)

    Could you please tell me how I can make this a global php variable?

    Thread Starter tchatz

    (@tchatz)

    I resolved this problem, but now I have another. Shortcode has a probelm. I use this shortcode

    <?php
    $cat = get_category( get_query_var( ‘cat’ ) );
    $category = $cat->slug;
    echo do_shortcode(‘[ajax_load_more category=”‘.$category.'” offset=”20″ scroll=”false”]’);
    ?>

    but plugin cannot read scroll and offset options.

    Plugin Author Darren Cooney

    (@dcooney)

    Does your category archive have more than 20 posts? Offsetting by 20 mean that the posts will start at 21.

    Thread Starter tchatz

    (@tchatz)

    No it has 10 but I set it to 20 to see if it works. The problem is not the value of offset. The problem is offset does not work.

    Plugin Author Darren Cooney

    (@dcooney)

    Offset does work. If you have 10 posts but you offset by 20, you will not return any posts.

    Thread Starter tchatz

    (@tchatz)

    But returns posts. I changed the offset to 10 and I set scroll to false. Both of them don’t work. You can see it here

    http://feelfamous.gr/v2/category/news-2/gossip/

    Plugin Author Darren Cooney

    (@dcooney)

    When viewing the source, I can see scroll is set to true.
    Sorry, maybe I’m not understanding what the issue is.

    Thread Starter tchatz

    (@tchatz)

    Yes, you have right. I found the problem. I pasted in the wrong template. I fixed it now. Sorry about this 🙁

    Thread Starter tchatz

    (@tchatz)

    And thank you very much!

    Plugin Author Darren Cooney

    (@dcooney)

    No problem!

    Hi i have this code to be added after the while loop this code is for hiding posts that are meant for specific subscribers
    <?php
    /* Get the post’s acceptable viewer. */
    $flautist_access = get_post_meta($post->ID, ‘smashing_flautist_access’, true );
    /* Get the post’s current viewer, if he or she is logged in. */
    if(is_user_logged_in()) {$current_flautist = $current_user->user_login;}
    /* See if the acceptable viewer and the current viewer are the same */
    if($flautist_access == $current_flautist || current_user_can(‘author’) || current_user_can(‘editor’) || current_user_can(‘administrator’))
    {
    ?>

    <div class=”clearfix”>
    <div class=”content files large-12 medium-12 small-12 columns”>
    <div class=”large-3 medium-3 columns thumbnail-image”>
    <?php if ( has_post_thumbnail() ) {
    the_post_thumbnail(‘thumbnail’);
    } else {
    ?>
    <img src=”<?php bloginfo(‘template_directory’); ?>/img/thumb.jpg” alt=”Thumbnail Logo” />
    <?php } ?>
    </div>
    <div class=”large-9 medium-9 small-12 columns”>
    <header>
    <h1>“><?php the_title(); ?></h1>
    <span class=”date”><?php the_date(); ?></span>
    </header>
    <?php the_excerpt(); ?>
    </div>
    </div>
    <?php } else { echo ”; } ?>

    when i add this to the repeater template it does not work how can i add that that it works?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Ajax Loop does not work and don't fetch any articles’ is closed to new replies.