Skip to content
Advertisement

Tag: wordpress

docker-compose, WordPress and MariaDB, PHP Fatal error: Uncaught mysqli_sql_exception: Connection refused

I have a WP project with following docker-compose configuration. When I try to connect my http://localhost to access the installation, I get 500 and I read this in the log: PHP Fatal error: Uncaught mysqli_sql_exception: Connection refused in /var/www/html/web/wp/wp-includes/wp-db.php I assume there is something wrong with the ip or the host but the weird thing is that phpmyadmin is working

Php function serialize() returns s:value but i don’t want this ‘s:’.What should I do?

I got this as an O/P: s:287:”a:3:{s:6:”actors”;a:2:{s:4:”name”;s:6:”Actors”;s:5:”value”;s:38:”Felicity Jones, Diego Luna, Alan Tudyk”;}s:8:”director”;a:2:{s:4:”name”;s:8:”Director”;s:5:”value”;s:14:”Gareth Edwards”;}s:6:”writer”;a:2:{s:4:”name”;s:6:”Writer”;s:5:”value”;s:36:”Chris Weitz, Tony Gilroy, John Knoll”;}}”; My Code:- I don’t need first s:287″ but this thing automatically save in my database. Help me please.. Answer The WordPress function add_post_meta() tries to serialize the passed data for itself. As you can see in the documentation of add_post_meta() it calls

Updating meta value for specific ids

I am updating post meta with this How can I add this metakey and metavalue not only to post ID 3100, but several other IDs? Answer You can define array of post ids and then you can iterate loop of ids. Try the below code. Update as per OP comment.

How to display extra text field on WordPress author page

I want to display an extra text field on the author page which I can fill in the respective user profile when I logged in. Additionally it would be great if the textfield has a WYSIWYG editor. How can I do that? Answer You can use the hook user_contactmethods to add some custom fields to the user page. See this

Advertisement