Wp-Property上的分页不起作用

时间:2015-07-03 15:34:47

标签: php ajax wordpress

我有一个使用Wp-Property的Wordpress网站,并且分页不起作用,任何人都可以帮忙解决这个问题。请从功能页面看下面的分页部分。

<?php if($use_pagination) { ?>
    if(!wpp_pagination_<?php echo $unique_hash; ?>) {
      jQuery("#wpp_shortcode_<?php echo $unique_hash; ?> .wpp_pagination_slider_wrapper").each(function() {
        var this_parent = this;
        /* Slider */
        jQuery('.wpp_pagination_slider', this).slider({
          value:1,
          min: 1,
          max: <?php echo $pages; ?>,
          step: 1,
          slide: function( event, ui ) {
            /* Update page counter - we do it here because we want it to be instant */
            jQuery("#wpp_shortcode_<?php echo $unique_hash; ?> .wpp_current_page_count").text(ui.value);
            jQuery("#wpp_shortcode_<?php echo $unique_hash; ?> .wpp_pagination_slider .slider_page_info .val").text(ui.value);
          },
          stop: function(event, ui) {
            wpp_query_<?php echo $unique_hash; ?> = changeAddressValue(ui.value, wpp_query_<?php echo $unique_hash; ?>);
          }

        });

        /* Fix slider width based on button width */
        var slider_width = (jQuery(this_parent).width() - jQuery(".wpp_pagination_back", this_parent).outerWidth() - jQuery(".wpp_pagination_forward", this_parent).outerWidth() - 30);
        jQuery(".wpp_pagination_slider", this_parent).css('width', slider_width);

        jQuery('.wpp_pagination_slider .ui-slider-handle', this).append('<div class="slider_page_info"><div class="val">1</div><div class="arrow"></div></div>');

      });
      wpp_pagination_<?php echo $unique_hash; ?> = true;
    }
    <?php } ?>
  });
</script>
<?php
$js_result = ob_get_contents();
ob_end_clean();

ob_start(); ?>
<div class="properties_pagination <?php echo $settings['class']; ?> wpp_slider_pagination" id="properties_pagination_<?php echo $unique_hash; ?>">
  <div class="wpp_pagination_slider_status">

      <?php
      if(function_exists('WPPFL_getNumberOfFavorites')) {
          $num_of_favorites = WPPFL_getNumberOfFavorites();
      } else{
          $num_of_favorites = 0;
      }

      $currentTemplate = "";
      if (isset($wpp_query['template'])) {
        $currentTemplate = $wpp_query['template'];
      }
      ?>
      <?php if ($currentTemplate==TEMPLATEPATH . "/list-my-property-content.php") { ?>
          <div class="wppcs-sub-menu">
              <?php global $post;
              $post_name = $post->post_name; ?>
              <?php $class='class="active"'; ?>
              <ul>
                  <li <?php if($post_name == 'list-my-property') { echo $class; } ?>>
                      <a href="<?php echo get_bloginfo('url'); ?>/list-my-property/">
                          View Listed Properties
                      </a>
                  </li>
                  <li <?php if($post_name == 'add-new-property') { echo $class; } ?>>
                      <a href="<?php echo get_bloginfo('url'); ?>/list-my-property/add-new-property/">
                          Add New Property
                      </a>
                  </li>
              </ul>
          </div>
      <?php } else { ?>
          <ul class="top_part">
              <li><a>Search results</a></li>
              <li class="favor"><a href="/favourite-properties">My Favourites(<span class="number_of_favorites"><?php echo $num_of_favorites; ?></span>)</a></li>
          </ul>
      <?php } ?>
    <div class="clear"></div>
  </div>
  <?php if($use_pagination) { ?>
  <div class="wpp_pagination_slider_wrapper">
    <div class="wpp_page_numbers_block">
        <span class="numbers-title">Pages</span>
        <?php
        if ($pages < 10) {
            for($i=1; $i<=$pages; $i++) {
                echo '<span class="page_numbers" data-value="'.$i.'">'.$i.'</span>';
            }
        } else {
            for($i=1; $i<=$pages; $i++) {
                if (($i < 4) || ($i>$pages-3)) {
                    echo '<span class="page_numbers" data-value="'.$i.'">'.$i.'</span>';
                }
                if ($i==4) {
                    echo '<span class="middle-pages"><span class="dotted-separator">...</span></span>';
                }
            }
        }?>
    </div>
    <div class="wpp_pagination_back wpp_pagination_button"><?php _e('Prev', 'wpp'); ?></div>
    <div class="wpp_pagination_forward wpp_pagination_button"><?php _e('Next', 'wpp'); ?></div>
    <div class="wpp_pagination_slider"></div>
  </div>
  <?php } ?>
</div>
<div class="ajax_loader"></div>
<?php
$html_result = ob_get_contents();
ob_end_clean();

谢天谢地。

1 个答案:

答案 0 :(得分:0)

可能导致您出现问题的第一件事是第三方插件或您的主题。因此,首先尝试停用第三方插件并将主题切换为默认主题,以确保该问题与其中任何一个都没有关系。 您也可以在此发送此类请求 https://wordpress.org/support/plugin/wp-property 或在我们的网站上 https://usabilitydynamics.com/contact-us/

的问候。 可用性动态支持

相关问题