Why would switch_to_blog stop working?

It appears that switch_to_blog might be too unpredictable to rely on for major site design. Here’s my first attempt at a SQL-based solution. function get_intro_post($blogid, $thumb_size=””) { global $wpdb, $post; // Get the system defined table prefix $prefix = $wpdb->prefix; // Create a full table prefix by combining the system prefix with the blogid $tbl … Read more

Comments Confusion

styles.css > line 537: (span.poster-roles) You haven’t defined … any offset to differ between author and admin for the sprite (author/admin) any additional class to make a difference between author/admin It seems that you wanted to only add the graphic for registered authors and admins (there’s nothing for guests). You’ll need to add … (on … Read more

Adding Pagination on a Custom Author Page

Put the following code in your functions.php file. function limit_posts_per_page() { if ( is_author() ) // you can limit other pages as well ( i.e. is_archive() ), if need be. return 5; } add_filter( ‘pre_option_posts_per_page’, ‘limit_posts_per_page’ ); Make sure your using the author.php template, otherwise it wont work. Please have a look at twentyten’s author.php … Read more

Change separators in HTML tags

It all depends on how your theme’s header.php is structured, but the most likely way is via the document_title_separator filter, as in add_filter (‘document_title_separator’, ‘wpse_set_document_title_separator’) ; function wpse_set_document_title_separator ($sep) { return (‘|’) ; }

Is it possible to replace PHP with NodeJS?

No. You can create your custom Node backend that communicates with WordPress via REST or GraphQL, but if you want to use WordPress’ functionality (such as add_filter, etc.), you need to use PHP. See this as an opportunity to learn a new programming language.

How to retrieve the value stored in a multi-dimensional array and SUM the entries?

The value is serialized, if you retrieve the meta data with the WordPress functions you’ll get that data back unserialized, and you’ll be able to iterate over it(looks like an array). $somevar = get_user_meta( ‘99999’, ‘your-key’, true ); As with options in WordPress, user meta is serialized when it’s an array or object, single values … Read more

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