Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.9.0
  8. * @ Author : DeZender
  9. * @ Release on : 08.08.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function bf_ust_menu_register()
  15. {
  16. register_nav_menus(['bfUstMenu' => __('Üst Menu', 'theme_prefix')]);
  17. register_nav_menus(['bfFooter1' => __('Footer Menü 1', 'theme_prefix'), 'bfFooter2' => __('Footer Menü 2', 'theme_prefix'), 'bfFooter3' => __('Footer Menü 3', 'theme_prefix'), 'bfFooter4' => __('Footer Menü 4', 'theme_prefix'), 'bfFooter5' => __('Footer Menü 5', 'theme_prefix'), 'bfFooter6' => __('Footer Menü 6', 'theme_prefix'), 'bfFooter7' => __('Footer Menü 7', 'theme_prefix')]);
  18. }
  19.  
  20. function bf_recent_post($limit)
  21. {
  22. $args = ['numberposts' => $limit, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true];
  23. $recent_posts = wp_get_recent_posts($args, ARRAY_A);
  24. return $recent_posts;
  25. }
  26.  
  27. function getPostViews($postID)
  28. {
  29. $count_key = 'post_views_count';
  30. $count = get_post_meta($postID, $count_key, true);
  31.  
  32. if ($count == '') {
  33. delete_post_meta($postID, $count_key);
  34. add_post_meta($postID, $count_key, '0');
  35. return '0 View';
  36. }
  37.  
  38. return $count . ' Views';
  39. }
  40.  
  41. function setPostViews($postID)
  42. {
  43. $count_key = 'post_views_count';
  44. $count = get_post_meta($postID, $count_key, true);
  45.  
  46. if ($count == '') {
  47. $count = 0;
  48. delete_post_meta($postID, $count_key);
  49. add_post_meta($postID, $count_key, '0');
  50. }
  51. else {
  52. $count++;
  53. update_post_meta($postID, $count_key, $count);
  54. }
  55. }
  56.  
  57. function sunset_load_moreNews()
  58. {
  59. $paged = $_POST['page'] + 1;
  60. $prev = $_POST['prev'];
  61. $catID = $_POST['cat'];
  62. if (($prev == 1) && ($_POST['page'] != 1)) {
  63. $paged = $_POST['page'] - 1;
  64. }
  65.  
  66. $query = new WP_Query(['post_status' => 'publish', 'paged' => $paged, 'category__in' => $catID, 'posts_per_page' => 10, 'ignore_sticky_posts' => '-1', 'order' => 'desc']);
  67.  
  68. if ($query->have_posts()) {
  69. while ($query->have_posts()) {
  70. $query->the_post();
  71. $current_id = get_the_ID();
  72. $category_ids = kategori_listele($current_id);
  73. echo '<div class="item" data-page="/page/' . $paged . '">';
  74. echo ' <div class="thumb"><a href="';
  75. the_permalink();
  76. echo '">';
  77. the_post_thumbnail('icerik_image', ['alt' => get_the_title()]);
  78. echo '</a></div>' . "\n" . ' ' . "\t\t\t\t\t\t\t\t" . '<div class="content-summary">' . "\n" . ' ' . "\t\t\t\t\t\t\t\t\t" . '<div class="title"><a href="';
  79. the_permalink();
  80. echo '">';
  81. the_title();
  82. echo '</a></div>' . "\n" . ' ' . "\t\t\t\t\t\t\t\t\t" . '<div class="summary">';
  83. echo get_snippet(get_the_content(), 30);
  84. echo '</div>' . "\n" . ' ' . "\t\t\t\t\t\t\t\t\t" . '<div class="categories">' . "\n" . ' <a href="';
  85. echo get_category_link($category_ids[1]);
  86. echo '">';
  87. echo get_cat_name($category_ids[1]);
  88. echo '</a>' . "\n" . ' ' . "\t\t\t\t\t\t\t\t\t\t";
  89.  
  90. if (@$category_ids[0]) {
  91. echo ' ' . "\t\t\t\t\t\t\t\t\t\t" . '<a href="';
  92. echo get_category_link($category_ids[0]);
  93. echo '">';
  94. echo get_cat_name($category_ids[0]);
  95. echo '</a>' . "\n" . ' ' . "\t\t\t\t\t\t\t\t\t\t";
  96. }
  97.  
  98. echo ' ' . "\t\t\t\t\t\t\t\t\t" . '</div>' . "\n" . ' ' . "\t\t\t\t\t\t\t\t" . '</div>' . "\n\t\t\t\t\t\t\t\t\t" . '</div>' . "\n\n\t";
  99. }
  100. }
  101. else {
  102. echo 0;
  103. }
  104.  
  105. wp_reset_postdata();
  106. exit();
  107. }
  108.  
  109. function sunset_check_pagedNews($num = NULL)
  110. {
  111. $output = '';
  112.  
  113. if (is_paged()) {
  114. $output = 'page/' . get_query_var('paged');
  115. }
  116.  
  117. if ($num == 1) {
  118. $paged = (get_query_var('paged') == 0 ? 1 : get_query_var('paged'));
  119. return $paged;
  120. }
  121. else {
  122. return $output;
  123. }
  124. }
  125.  
  126. function sunset_load_moreAuthor()
  127. {
  128. $paged = $_POST['page'] + 1;
  129. $prev = $_POST['prev'];
  130. ...................................................................
  131. ...........................................
  132. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement