Display tags with a twist

the_tags() is simple for convenience, if you want more control over formatting, use get_the_tags() and output them however you want. EDIT – quick example for the template: <?php $posttags = get_the_tags(); if ($posttags) { echo ‘Read more about ‘; $tag_count = count( $posttags ); $count = 0; foreach( $posttags as $tag ) { $count++; if( … Read more

Get multiple db prefix with $wpdb

Write a function that uses $wpdb->prefix as a fallback. Something like this: function wpse65880_table_with_prefix($table) { // should define array in config file, rather than hard coding $my_tables = array(“table1”, “table2”, “table3”, “table4”); if (in_array($table, $my_tables)) { // “qa_” should also be a config file setting return “qa_” . $table; } else return $wpdb->prefix . $table; … Read more

Can I create front-end editable user profile pages with WordPress? How do I do it?

Rarely do I answer question with simply a plugin recommendation – and I’d never recommend a commercial one – but since there’s a really good plugin for the task of front end profiles/login and such out there, I cannot let it go unmentioned: Check out Theme-My-Login by Jeff Farthing. There ain’t no better solution. It’s … Read more

Programmatically add a custom page/path/url/route to WordPress

The idea is just to programmatically create a path/url in a plugin for a WordPress site (like, “[mysite]/mypath”), and then load an arbitrary html or php file. In case anyone else is looking for something similar, this works for me (in my main plugin function file): register_activation_hook(__FILE__, ‘myplugin_activate’); function myplugin_activate () { create_custom_page(‘mytestpath’); } function … Read more

Virtual Pages plugins

I’m the author of that plugin and I can confirm there was an issue. It was in the GM\VirtualPages\TemplateLoader::init(); method. Issue was caused by an untested switch from array_merge to wp_parse_args. They are similar, but I would have to inverse order of arguments moving from one to the other. Shame on me. I fixed that … Read more

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