• Skip to primary navigation
  • Skip to main content

WP Discuss

Wordpress Research & Analytic

  • Submit
  • Disclaimers
  • About
  • DMCA
  • Privacy Policy
  • Contact

6 ciudades antiguas

  • No categories
  • All

Retrieve custom post types by custom taxonomies with WP_Query

March 13, 2019 by Leave a Comment

I am trying to filter custom post type data using ajax. For that, I display some custom taxonomies as select tags. I've been trying for 6 hours to retrieve custom post types using WP_Query with these custom taxonomy arguments, but I am not able to get the query working. This is my custom post type: function cpt_retiro() { $labels = array( 'name' => _x( 'Retiros', 'Post Type General Name', 'break-breath' ), 'singular_name' => _x( 'Retiro', 'Post Type Singular Name', 'break-breath' ), 'menu_name' => __( 'Retiros', 'break-breath' ), 'name_admin_bar' => __( 'Retiros', 'break-breath' ), 'archives' => __( 'Archivos del retiro', 'break-breath' ), 'attributes' => __( 'Atributos del retiro', 'break-breath' ), 'parent_item_colon' => __( 'Elemento padre', 'break-breath' ), 'all_items' => __( 'Todos los retiros', 'break-breath' ), 'add_new_item' => __( 'Añadir nuevo retiro', … [Read more...] about Retrieve custom post types by custom taxonomies with WP_Query

Learn More

I can’t translate text in my plugin using a .mo file, load_plugin_textdomain() function is always false

March 15, 2019 by Leave a Comment

I create a plugin just for testing /** * @package SurveyPlugin * @version 1.0 */ /* Plugin Name: Survey Plugin Plugin URI: http:marcogomesweb.com Description: This is survey Author: NodeLondon Version: 1.0 License: GPLv2 or later Text Domain: survey-plugin */ function get_dummy_text() { $text = [ __( 'city hotels' , 'survey-plugin' ) ]; return $text[0]; } add_action('admin_notices', 'show_dummy_text'); function show_dummy_text(){ $text = get_dummy_text(); global $locale; echo "<br>". $locale . "<br>"; echo "<p id='wp-admin-motivation'>$text</p>"; } add_action( 'plugins_loaded', 'wan_loaded_textdomain'); function wan_loaded_textdomain(){ $loadfiles = load_plugin_textdomain('survey-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); plugin_basename( __FILE__ ). '/languages/' ); var_dump($loadfiles); // is always false } I install Poedit I create a .mo file survey-plugi-es_ES.mo in /plugins/survey-plugin/languages/ survey-plugi-es_ES.mo msgid … [Read more...] about I can’t translate text in my plugin using a .mo file, load_plugin_textdomain() function is always false

Learn More

google translate text, translate text to voice, translate text to spanish, english to tagalog dictionary translation text, translate text from italian to english, swahili to english translation text, translate text to speech, translate text to english, braille translator text to dots, translate text to braille

How to display custom post type pagination buttons when processing AJAX request

March 19, 2019 by Leave a Comment

Good morning everyone, I am trying to filter posts using ajax by custom fields and custom taxonomy values from a custom post type. Ajax request works fine, It retrieves all needed data to display, but I am not able to handle pagination links. This is my JQuery request code: $('#boton-filtrar').click(function (e){ let filter = $('#formulario-filtro'); $.ajax({ url: filter.attr('action'), data: filter.serialize(), type: filter.attr('method'), beforeSend: function() { $('#boton-filtrar').prop('disabled', true); $('#boton-filtrar').html('<span class="spinner-border spinner-border-sm"></span>Buscando retiros...'); }, success: function(data) { mostrar_filtros(false); $('#despliegue-retiros').html(data); $('#boton-filtrar').prop('disabled', false); $('#boton-filtrar').html('<span>Aplicar filtros</span>'); }, error:function(data) { console.error(data); } }); return false; }); And this is the main function: function filtrar_posts() { $paginado = … [Read more...] about How to display custom post type pagination buttons when processing AJAX request

Learn More

custom lcd display, post processing, Display Type TFT, customer requests, change request process, customer request, 4 customer personality types, type button, Custom Button, button type

Double count view in archive.php

March 11, 2016 by Leave a Comment

I'm having a hard time using this snippet I'm getting double views each time the post is queried. This is in my functions.php file: function getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); return "0"; } return $count; } function setPostViews($postID) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, $count_key, $count); } } // Remove issues with prefetching adding extra views remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); Then I places setPostViews(get_the_ID()); into a template part that i loop in the archive.php like this: <?php $term = $wp_query->queried_object; $args=array( 'post_type' => 'anuncio', … [Read more...] about Double count view in archive.php

Learn More

count in php mysql_num_rows, real time views count, live youtube video view count, live video view count

Contact form 7 not clickable on iphone

June 22, 2019 by Leave a Comment

The below form (webpage here), built using Contact form 7 is not clickable on iPhone. I can't find out why. Would you be able to help? <div class="one-third"> [select* Title "Title" "Mr." "Mrs." "Miss."] </div> <div class="one-third"> [text* firstname placeholder "First Name"] </div> <div class="one-third last"> [text* Lastname placeholder "Last Name"] </div> <div class="one-half"> [text company placeholder "Company"] </div> <div class="one-half last"> [select* country "Country" "United Kingdom" "Afghanistan" "Albania" "Algeria" "American Samoa" "Andorra" "Angola" "Anguilla" "Antigua and Barbuda" "Argentina" "Armenia" "Armenia" "Aruba" "Australia" "Austria" "Azerbaijan" "Azerbaijan" "Bahamas" "Bahrain" "Bangladesh" "Barbados" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia" "Bonaire" "Bosnia and Herzegovina" "Botswana" "Bouvet Island (Bouvetoya)" "Brazil" "British Indian Ocean Territory (Chagos Archipelago)" … [Read more...] about Contact form 7 not clickable on iphone

Learn More

html contact form, contact form generator, contact us form for website, contact us web form, contact form, Contact form WordPress plugin, i accidentally deleted a contact on my iphone, easy contact form, easy contact form html, emergency contact form

Copyright © 2021 WP Discuss. Power by Wordpress.