Victor Campuzano
Forum Replies Created
-
I found a bug in my queries. This doesn’t work properly.. Do not use in a production database.
I’m working on solve it…
Sorry!
I want to discuss this possible solution.
For a given category ID (5) we do:
1. Clear primary category for all posts in this category.
2. Set this category as the primary category for all posts.So, for example, if 100 articles are attached to the category 5 (and others), this category will be the primary for all of this 100 posts.
Solution:
CLEAR PRIMARY CATEGORY:
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE ID IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 5 ) ) and meta_key = '_yoast_wpseo_primary_category'SET CATEGORY 5 AS THE MAIN CATEGORY FOR ALL POSTS WICH ARE ATTACHED TO THIS CATEGORY.
INSERT INTO wp_postmeta(post_id,meta_key,meta_value) SELECT ID, '_yoast_wpseo_primary_category', 5 FROM wp_posts WHERE ID IN (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 5)Make sure you:
1. Backup your database before any update.
2. Change the 5 to the ID of your desired main category.What do you think about this solution?
- This reply was modified 9 years, 2 months ago by Victor Campuzano.
I’m also interested on this! 🙂
Hello!
I’m also interested on this topic. It would be great to set primary category for all posts / products in the “bulk edit” or maybe a “set this category as primary” when you edit the category.
I dont’ know hot to do this, but it would be great … 🙂
Forum: Plugins
In reply to: [Vcgs Toolbox] Ya no me funciona en ordenadoresSupongo que ya estará todo ok. Saludos!
Forum: Plugins
In reply to: [Vcgs Toolbox] Ya no me funciona en ordenadoresHola a_les!
Si, mira. He estado viendo tu página y el problema parece estar desde que cambiaste desde http a https. En realidad, todo funciona bien a excepción de la librería jQuery que la cargas desde http y provoca un error.
Muchos de los plugins de WordPress se basan en jQuery. Incluido el mio.
Echa un vistazo a este hilo donde tal vez te ayude a resolverlo: https://ww.wp.xz.cn/support/topic/mixed-content-ssl-httphttps-issue?replies=8
Ya me cuentas! 🙂
Forum: Plugins
In reply to: [Vcgs Toolbox] Seleccionar y tuitearJajajajaja. Pues no veas la ilusión que me hace, me siento satisfecho.
Te por seguro que cualquier duda o problema que te surja intentaré con todos mis conocimientos solventarlo.
Ya me irás contando! 🙂
Forum: Plugins
In reply to: [Vcgs Toolbox] Seleccionar y tuitearAcabo de publicar la versión 1.9.6.2 que, si no se me ha escapado nada, corrige los problemas que comentas.
Por favor, pruébalo cuando puedas y me dices.
Gracias de nuevo! 🙂
Forum: Plugins
In reply to: [Vcgs Toolbox] Seleccionar y tuitearGracias!!
Me has ayudado mucho a encontrar dos casos no cubiertos que seguro no serás el único que los tiene. Lanzaré la actualización lo antes posible, que corrige ambos errores.
De momento, decirte que ninguno de ellos provoca ningún tipo de error Javascript sino es una cuestión de que no contemplo todas las posibilidades.
Puedes dejar el plugin y la opción activados que, aunque no te funcione, tampoco provoca errores Javascript.
De verdad, lo antes posible lanzo la 1.9.6.2 que tendrá corregido para tus dos blogs.
Gracias por el feedback! 🙂
Forum: Plugins
In reply to: [Vcgs Toolbox] Seleccionar y tuitearHola!
La opción de Selecccionar y tuitear no está activada por defecto. Asegúrate que la has activado desde la configuración del Plugin, en la pestaña de Piopialo, al final del todo.
En el caso que si la tengas activada, puede deberse a un error de Javascript. En ese caso lo ideal sería que me avisases de tu URL y lo compruebo.
En la versión 1.9.6.1 corrijo unos cuantos errores Javascript.
Saludos y gracias por el Feedback! 🙂
Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updateI solved it using another type of code.
add_filter('comments_clauses', array($this, 'return_missing_list') , 10, 2); public function return_missing_list(array $pieces, WP_Comment_Query $query) { if (! is_admin()) { return $pieces; } // Esta función sólo se puede ejecutar si es admin $current_screen = get_current_screen(); // bail on anything not admin if ( is_admin() && ('edit-comments' == $current_screen->base) && (isset($_GET['missing_reply']))) { global $wpdb; $pieces['join'] = " INNER JOIN wp_commentmeta ON ( wp_comments.comment_ID = wp_commentmeta.comment_id )"; $pieces['where'] = "(comment_approved = '1') AND (comment_date >= DATE_SUB(NOW(), INTERVAL 1 MONTH)) AND (wp_commentmeta.meta_key = '_cnrt_missing') AND comment_type != 'pingback' AND comment_type != 'trackback'"; } return $pieces; }Hope you find it useful.
Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updateAny ideas?
Why it applies the “date” filter but nothing about the meta_key & meta_value statement?.
Thanks!
Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updateThanks Navnell.
I don’t know why, but it applies the date filter but not the meta_key = meta_value .
New syntax about meta queries?
Forum: Plugins
In reply to: [Comments Not Replied To] Ignore Certain Comments/Track BacksHi All!!!
I Think the easiest way to filter trackbacs is change this line:
// create link $status_link = '<a href="edit-comments.php?comment_status=all&missing_reply=1" ' . $current . '>';By this line:
// create link $status_link = '<a href="edit-comments.php?comment_status=all&missing_reply=1&comment_type=comment" ' . $current . '>';Simply add
comment_type=commentto the end of the url filter to get all comments not replied to.It works for me!!!
Regards .. 🙂