Upload Image in a WordPress page using PHP

Implementing your own upload form like this can be a major security vulnerability, you might want to instead use a library/script where such potential issues are already dealt with properly. Here is one I remember using successfully on a project for a similar purpose (user uploaded video)… though it may be more than what you … Read more

Include chat (HTML, js, css) in all pages of WordPress

Try to include your inline script at the bottom of your snipper.js file, and then enqueue it using wp_enqueue_scripts(): function my_chat_script() { wp_enqueue_script( ‘chat-js’, ‘URL OF SNIPPER HERE’, false ); } add_action( ‘wp_enqueue_scripts’, ‘my_chat_script’ ); This is the proper way to include scripts in your WordPress using functions.php file. However, if you insist on adding … Read more

An unwanted inline style is added to my body tag

After searching a lot, I realized that elements inside my head tag are shown inside body tag and head tag contains nothing in my generated HTML code. This happened because I had used UTF-8-BOM encoding and by changing it to simple UTF-8 everything was fixed.

WordPress’ visual editor messing up my (nested) lists (and other things as well)

Instead of using the “type” attribute, try adding a CSS class and styling that. <ol> <li>Number one</li> <li>Number two <ol class=”lower-alpha”> <li>Lowercase a</li> <li>Lowercase b <ul> <li>Paragraph 1</li> <li>Paragraph 2</li> </ul> </li> </ol> </li> </ol> Then in your CSS – depending on your site setup, you may want to add Custom CSS through the Customizer, … Read more

Correct syntax to html php conversion

you are missing the three curly brackets in before wp_reset_postdata(). backup your code and replace with this. <?php $args = array(‘post_type’ => ‘menu’, ‘posts_per_page’ => 5, ‘post__in’ => $ids, ‘post_status’ => ‘any’, ‘orderby’ => ‘post__in’); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); if (is_page(538) ) … Read more

Is absolute control possible with WordPress

WordPress is just a CMS written in PHP language (well, some Javascript, HTML, and CSS too). It means if you’re building a self-hosted WordPress website (or, as you call it, WordPress.org) – you have absolute and total control and can do whatever you need. However, the possibilities are limited – by your own knowledge and … Read more