Adding graphics to 404.php page

How are you changing the text and links? If you’re editing a 404.php file, then you simply need to add html to output whatever images you want, i.e.: <img src=”https://www.google.com/images/logos/ps_logo2.png” /> Will output this: For more on HTML, check out w3schools.com’s excellent material: http://www.w3schools.com/html/

if statement on database query

On your if(), it should be like this: if (!($wpdb->get_row(“SELECT voter_ip FROM ” . $wpdb->prefix . “voter_ips WHERE post_id = $post_id AND voter_ip = ‘$voter_ip'”) Notice the quotation mark added on $voter_ip.

WP database error for comments_popup_link()

Your template code includes $wpdb->print_error(). This function prints the last database error between [ and ] brackets, and the executed SQL code. But if there is no error, you just see the empty brackets and the SQL. $wpdb->show_errors() is used to enable displaying of database errors. If you want to see all database errors, you … Read more

Can’t use get_results() in ajax query

This will not work because you call example.com/markers.php directly, and that file does not load anything from WordPress, like the $wpdb object. You can include wp-load.php, but this might break if you move the WordPress installation to somewhere else. To be more in line with how Ajax calls in WordPress should be made, you should … Read more

Categories Template Assistance

Remove the cat parameter from your query and name your template file category.php From the WordPress Codex on Template Hierarchy; 1. category-{slug}.php – If the category’s slug were news, WordPress would look for category-news.php 2. category-{id}.php – If the category’s ID were 6, WordPress would look for category-6.php 3. category.php 4. archive.php 5. index.php The … Read more

Mail not sent when I set HTML headers

There’s the wp_mail() function in WordPress. The headers have to be added as array without trailing \n\r or similar. Example wp_mail( ‘[email protected]’, ‘Hello World!’, ‘Just saying…’, array( ‘MIME-Version: 1.0’, ‘Content-type: text/html; charset=iso-8859-1’, sprintf( ‘From: %s <no-reply@%s>’, get_bloginfo(‘name’), site_url() ), sprintf( ‘X-Mailer: PHP/%s’, phpversion() ), ) ); To change the content type you could as well … Read more

Limiting the WordPress feed to only a certain limit of characters

You can select between Full text and Summary in the Reading settings: If you select the Summary, then a) To control the number of words in the feed summary you can use: add_filter(‘excerpt_length’,’custom_excerpt_length’); function custom_excerpt_length( $num_words ){ return 30; // number of words to show } The default number of words in the summary is … Read more