Attachment page tag queries & posts not found

That page isn’t a 404, it’s returning a status code 200. The title and body tags also indicate that the page is loading just fine. A couple of things- there is no taxonomy argument. It would be redundant anyway, since the query already contains the queried taxonomy and term pulled from the parsed URL. Your … Read more

Query posts and display all dates in repeater field in chronological order

I think I succeeded in making the array and sorting it by date (see var_dump) array(575) { [320]=> array(10) { [“Speeldatum”]=> string(19) “2015-01-30 12:00:00” [“Productienaam”]=> string(28) “THE DOG DAYS ARE OVER (2014)” [“Makernaam”]=> string(11) “Jan Martens” [“Locatienaam2”]=> string(10) “toneelhuis” [“Stadnaam”]=> string(9) “ANTWERPEN” [“Landnaam”]=> string(2) “BE” [“Festivalnaam”]=> string(18) “antwerpse kleppers” [“Onderdeelvandezegripeveningnaam”]=> string(38) “antwerpse kleppers / bourla … Read more

Performance bug – slow DB query

It is relatively rare for WP to have query performance issues on a small to moderately sized site: The queries it typically runs are reasonable (not perfect, but reasonable). A lot of things queried are aggressively cached within page load, and persistently with object cache available. While you certainly can throw enough code at it … Read more

How to do a MySql query in WordPress?

You can write your own MySQL queries by getting the global $wpdb variable and preparing a SQL statement and then getting the results. global $wpdb; $prepared_query = $wpdb->prepare( ‘SELECT * FROM [your_table] WHERE LAST_INSERT_ID();’ ); $results = $wpdb->get_results( $prepared_query ); Please, be very careful when using this, if you do it incorrectly, it could be … Read more

How to make a parent page for author.php?

You can add this pages with new rewrite rules like that : add_action(“init”, function () { add_rewrite_tag(“%specialAuthor%”, “([^&]+)”); foreach ([“personalinformation”, “settings”] as $specialAuthor) { add_rewrite_rule( “author/([^/]+)/($specialAuthor)/?$” , “index.php?author_name=\$matches[1]&specialAuthor=\$matches[2]” , “top” ); } }); add_filter(“author_template_hierarchy”, function ($templates) { $specialAuthor = get_query_var(“specialAuthor”, NULL); if (isset($specialAuthor)) { $author = get_queried_object(); $templates = [ “$specialAuthor-{$author->user_nicename}.php”, “$specialAuthor-{$author->ID}.php”, “$specialAuthor.php”, ]; } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)