How to optimize and reduce excessive database queries

You can use a combination of caching plugin and appropriately coded themes and plugins to cache query results and speed things up. Yes, eventually if you are running many queries, a site can get bogged down. This typically happens when query-intensive themes or plugins are used. To start investigating your own site’s queries, there are … Read more

How To Get HTML Eelement From Another Page

You’re talking about scraping, which is generally an unreliable method of getting data, especially if you don’t control the other page. However, in PHP, once you retrieve the download page with something like wp_remote_get, you can use a regular expression to extract the pieces you need with preg_match_all. $response = wp_remote_get( ‘domain.com/download-page/’ ); $page = … Read more

WordPress creating a compund query or using data from one post type to access another

As per WP documentation, Using the WP_Meta_Query::parse_query_vars( $query ) method: You can use this method, if you want to use the simple query args(meta_key, meta_value, meta_type, meta_compare), or if you are unsure of the presence of meta query parameters. Hence, I tried converting meta_key, meta_value and meta_compare in source code to wrap inside meta_query as … Read more

How to translate to spanish wordpress hardcoded content/files?

So it depends, one 2 things: hardcoded HTML tags containing spanish text i18n api text, e.g. echo __( ‘string’, ‘textdomain’ ); You want the latter, but the theme author may not have used that API Hardcoded HTML tags This is when the text is hardcoded in the file, e.g. <p>spanish text</p> <?php echo “spanish text”; … Read more