Creating custom function in wordpress to return data from database
In your header.php $images = getSliderImages(); foreach ( $images as $img ) { echo ‘<img src=”‘ .$img. ‘” />’; }
In your header.php $images = getSliderImages(); foreach ( $images as $img ) { echo ‘<img src=”‘ .$img. ‘” />’; }
Yes it is possible to create templates for different categories and tags for posts you can also use a plugin like this http://wordpress.org/extend/plugins/custom-post-background/ If you look at (for example) http://woothemes.com – then their free theme it already has a blog, portfolio and photo gallery templates for you. This might help you to see what is … Read more
If you want to do that yourself, take a look at function add_meta_box (don’t forget the examples). That page has almost everything you need to create a custom meta box for a certain post type. If you want to simplify your work, you might want to use an utility like Meta Box plugin. This plugin … Read more
You can create capabilities for each custom post type and add this to the different roles; see this answer from an question here.
Move the custom post types to a plugin. They should never be part of a theme for exactly the reason you asked here. 🙂 In your theme add just the needed template files, but not the code for post type registration.
The following line is incorrect as showposts is deprecated. $recent = new WP_Query(“showposts=30”); Instead use, $recent = new WP_Query(‘posts_per_page=30’); Following that, Does the thumbnail size of 80×80 exist? array(80,80) If not try any of, $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), small ); $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), medium ); $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), large ); Remember each of … Read more
i’d use custom post type “slideshow” and multiple custom field “image” only. Plugin named Types should do the trick for you, but you’ll still have to code the slideshow
A sub-menu generally is made by adding another ul/li elements inside an li, like this: <ul> <!– Menu –> <li>Menu item 1</li> <li>Menu item 2</li> <li>Menu item 3 <ul> <!– Sub Menu –> <li>Sub item 1</li> <li>Sub item 2</li> </ul> </li> </ul> But if you want some dropdown menu, you have to add some css, … Read more
Here are some useful guides that may help with the page development in wordpress… http://codex.wordpress.org/Pages http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/
Sounds like you … Don’t have mod_rewrite installed or enabled Or your .htaccess file in not being edited To check the first make a file with <?php phpinfo(); in it, save it to your server– same place you have WordPress– named something like phpinfo.php, and load the file in a browser. Look for mod_rewrite. It … Read more