Proper procedure for wp_insert_post?

WordPress just adds a new entry, the title is not unique, but there is a field guid which is. Permalinks do get an incremental number. Yes, you should remove it from your theme, you’d better write your own plugin for this kind of stuff. I don’t totally understand what you mean, is there no menu … Read more

‘x’ Converted to html code in example: 5×10

This is performed by wptexturize(). Unfortunately it saves replacement lists as static variables which you can’t modify. So your options are: Remove wptexturize filter from related hook (depends on where you have that replacement done). Write and add your own filter that will replace converted symbol back.

Link to Particular Page Within Template PHP Code

You probably want to use get_permalink and get_the_title. Example: <a href=”https://wordpress.stackexchange.com/questions/19555/<?php echo get_permalink( YOUR POST ID ); ?>”><?php echo get_the_title( YOUR POST ID ); ?></a> Replace YOUR POST ID with the ID of the post you’d like to link to. Post ID’s will change from install to install, however, so this might not work as … Read more

How can I use custom properties to set different background on different pages?

You get custom field values with get_post_meta(). WordPress has a function called wp_localize_script() that’s used to, as the name suggests, localized scripts by creating a javascript object from a PHP array. When you use wp_enqueue_script() to add a script to the front end of wordpress, you can “localize” it by calling wp_localize_script() afterwards. If you … Read more

How to create a “latest news” page showing a list of posts from blog category

Probably the get_posts tag. It’s simple, you just need a loop. <?php $args = array( ‘numberposts’ => 5, ‘cat’ => 5 ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <div> <?php the_date(); ?> <br /> <?php the_title(); ?> <?php the_excerpt(); ?> </div> <?php endforeach; ?> That will show the last … Read more

Getting values from options page to css

You are doing it correctly. I would suggest two enhancements: Do not put this code directly in header.php. Create a custom function to print the css and hook this into the wp_head action. Always sanitize/escape input before you print it to the screen. Look into ctype_xdigit() for creating a custom function to sanitize you color … Read more