Deeper editing of index.php and single.php

hey add the following code in your index.php file to show the three recent blog post like this <?php query_posts(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 3, ‘order’ => ‘ASC’, )); ?> <?php if ( have_posts() ) :?> <?php while ( have_posts() ) :the_post(); ?> <!– Start BlogItem –> <article id=”post-<?php the_ID();?>” <?php post_class();?>> <?php the_post_thumbnail( … Read more

Call featured image url

the_post_thumbnail() is highest level function for it, which will output complete HTML. If you need some lower level parts, digging deeper are nested: get_the_post_thumbnail() wp_get_attachment_image() wp_get_attachment_image_src()

WPDB secure custom form

When getting user input to be stored on database, a good way to proceed is: Data validation: validate the data according whith the data you expect. For example: HTML string, number, email, URL, any text with no HTML, ect. Never trust on user input or client-side validation. You can make here also some sanitization, but … Read more

Nav-Menu not showing up

To see the menu, you need to set it up in the wordpress admin side. Go to Appearance -> Menus You should see a “Manage Locations” tab. Select it. You should see your “Main Menu” location. Choose the menu that you created there. Select Save Changes. Since you used “theme-location” to set up drawing it, … Read more

Only load certain artists on this page

if you want to show only 2, put it as a value, like so: ‘posts_per_page’ => 2 For the newest posts, you need to change the sort using the order and orderby params: ‘orderby’ => ‘date’, ‘order’ => ‘ASC’ Details about orderby params here: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters Also, you should avoid the query_posts use. Except if you … Read more

How to Display a List of Child Pages For a Parent Page in WordPress

you can use post_status. post_status A comma-separated list of post status types that should be included. For example, ‘publish,private’. possible values are: (publish|inherit|pending|private|future|draft|trash) or you can also play with: include Only include certain Pages in the list generated by wp_list_pages. This parameter takes a comma-separated list of Page IDs. more about it here.. http://codex.wordpress.org/Function_Reference/wp_list_pages

Disable Checkbox depending on state of another checkbox

This may be a little overkill for you needs, but I use a bulked up version of this to great effect on my site. This script will – Check what state the first_option_required option shold be in on page load (and set) Change the state of the first_option_required button upon changes to the first_option_show option. … Read more

Pass important values server-side when processing form

To be honest I think this question is off topic, because its topic is so a general concept that can apply to any language capable to handle web development. So is even broader than a general PHP question. By the way, what I want to suggest is too much for a comment. When you need … Read more