adrianperez
Forum Replies Created
-
Forum: Plugins
In reply to: [Transient Cleaner] Latest version don’t seem to clear the transientSorry! I didn’t receive the answer notification. When I created or edit a post the json load the new transient content that would be the correct if the plug clean it before, but now it’s not working with the new updates ??
I modify the code and I founded that is the ‘after_db_upgrade’ that is not firing, when I change it to ‘save_post’ in the add_action( ‘after_db_upgrade’, ‘tc_clear_transients’ ) it works but I would need (and I guess is more correct) to have the cleared trnasient when it changes the DDBB, any ideas where to go?
Thanks!
Forum: Plugins
In reply to: [Anything Order] Prev Next post link not orderedI solved finally this way, I put here if anyone needs it (the code may be not perfect)
<? //Variables $currentID = get_the_ID(); $prevID; $nextID; $allID = array(); //Create a query $theQuery = new WP_Query( 'post_type=post' ); //Create the array with all the ID's while ( $theQuery->have_posts() ) { $theQuery->the_post(); array_push($allID, get_the_ID()); } //Check lenght of the array $allIDlenght = count($allID) - 1; //Check our actual ID position on the array $position = array_search($currentID, $allID); //If it's in the first position if($position === 0){ $prevID = $allID[$allIDlenght]; $nextID = $allID[1]; //If it's in the last one }else if($position === $allIDlenght){ $prevID = $allID[$allIDlenght-1]; $nextID = $allID[0]; }else{ $prevID = $allID[$position-1]; $nextID = $allID[$position+1]; } ?>
Forum: Plugins
In reply to: [Anything Order] Prev Next post link not orderedHi @marco87x, same problem here, did you find any workaround???
Forum: Plugins
In reply to: [Custom Users Order] Can I use the order set with this plugin for get_users?I have the same doubt! Did you finally could resolve it @rimfya?
Thanks!
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastYes! It’s the first time that I have this problem migrating a wordpress into the same server, thanks for the document, it was very instructive, by chance, if I change all the title the wordpress upload the new post with the correct charset, by the moment ??
Thanks bcworkz!
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastI found it!
The guy who makes the original code told me that the new post could be saved in a different charcter set, I migrate the web just before and when I change a name to any post and save it, it comes to the same charcter set and the new list…so now I have to re-save all posts and they will come to the normality…I hope ??Thanks!
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastMe neither ?? the code posted above it’s the one that you can see in the link, but I didn’t understand anything, cause numbers works fine but new post comes down and didn’t follow the order…
Really strange…I was thinking that maybe it?s for the query_posts, I read about it and it’s very fragile, will continue working on it, if I found why I will post here the solution.
On the other hand I think I will remake the code with your solution, again ??
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastHi again!
I can’t believe it, now I have all this working (here the web, https://aristu.com/lista/ ) but when I add a new post or edit one title, it moves to the end of the list. I couldn’t understand, with number it works and order it in the correct places.Here’s the code that I finally modify, apparently now I don’t need the code used before to put number last…
<?php /* Template Name: List all posts */ ?> <?php get_header(); ?> <!-- Section --> <section> <div id="main-background"> <div id="main-column"> <div class="margin-top"></div> <div id="a-z"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array ( 'posts_per_page' => -1, 'post_type' => 'post', 'orderby' => 'title', 'order' => 'ASC', 'paged' => $paged, 'caller_get_posts' => 1 ); query_posts($args); if ( have_posts() ) { while ( have_posts() ) { the_post(); $first_letter = mb_strtoupper(mb_substr(apply_filters('the_title',$post->post_title),0,1,'UTF-8'), 'UTF-8'); $signos = array("?", "!"); if (in_array($first_letter, $signos)) { $first_letter = mb_strtoupper(mb_substr(apply_filters('the_title',$post->post_title),1,2,'UTF-8'), 'UTF-8'); } $acentos = array ("á", "é", "í", "ó", "ú"); if (in_array($first_letter, $acentos)) { $first_letter = mb_strtoupper (trim(preg_replace('~[^0-9a-z]+~i', '-', preg_replace('~&([a-z]{1,2})(acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($first_letter, ENT_QUOTES, 'UTF-8'))), ' ')); } if ($first_letter != $curr_letter) { if (++$post_count > 1) { end_prev_letter(); } start_new_letter($first_letter); $curr_letter = $first_letter; } ?> <div class="title-cell"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div> <?php } end_prev_letter(); ?> <?php } else { echo "<h2>Sorry, no posts were found!</h2>"; } ?> </div><!-- End id='a-z' --> </div><!-- End class='margin-top --> </div><!-- End id='rightcolumn' --> <?php function end_prev_letter() { echo "</div><!-- End of letter-group -->\n"; echo "<div class='clear'></div>\n"; } function start_new_letter($letter) { echo "<div class='letter-group'>\n"; echo "\t<div class='letter-cell'>$letter</div>\n"; echo "<div class='clear'></div>\n"; } ?> </section> <!-- /Section --> <?php get_footer(); ?>
Forum: Hacks
In reply to: HTML tags stript on manual excerptHi, totally my fault, I put the_excerpt on single page for the meta description and, obviously, it doen’t accept html tags, so the solution was to strip tags in this output and all worked fine (in fact, I don’t need any code cause manual excerpt allow html tags)
Thanks anyway!
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastIt works like a charm, thanks for your time bcworkz, really, this is your code but pointing to a specific page:
add_filter('posts_orderby', 'reorder_query', 10, 2); function reorder_query($order, $query) { global $wpdb; if ($query->is_page('SLUGOFYOURPAGE')) $order = "{$wpdb->posts}.post_title + 0, {$wpdb->posts}.post_title"; return $order; }
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastThanks bcworkz, really, I spend hours before ask something to the support, most times I arrive searching, but I have no luck with some ones in this site ??
best!
Forum: Hacks
In reply to: HTML tags stript on manual excerptOk, it’s true, no bumping, sorry. I searched all this solution but I didn’t solved the problem and I tried all this options.
https://wordpress.stackexchange.com/questions/48281/issue-with-enabling-formatting-in-excerpts-in-wordpress
https://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/automatically-control-manual-and-auto-generated-excerpt-in-wordpress/
https://shibashake.com/wordpress-theme/wordpress-excerpt-how-to-style-it
google —. enabling formatting in manual excerptsThanks in advance.
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastYep, I try it, but it doesn`t work. I obtain the same result with:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array ( 'post_type' => 'post', 'orderby' => 'title+0, title', 'order' => 'ASC', 'paged' => $paged );
Any idea? Thk!
Forum: Hacks
In reply to: Post results alphabetically, but with numbers lastThanks bcworks for your reply, but in fact I haven’t this problem (but anyway I fix it for the future), the problem it’s that I try to put the numbers last, don’t first, now I have this and I need to have the numbers after the letters ??
1
15 M
8
80–90 Comunicación
A
ADG/FAD Campa?a
Ausonia Packs
Ausonia TV
B
Balay
Barcelona 2159
Biografía del miedo
Buen viaje ExcelenciaForum: Hacks
In reply to: HTML tags stript on manual excerptI forget, I also try the advanced excerpt plugin and I activated excerpt in pages, but, don’t know why, there html works.
Any idea?
Thk.[No bumping, thank you.]