You can try this
Random from a set of images :
<img src="http://www.mywebsite.com/images/image_<?php echo rand(1,10); ?>.jpg" alt="" />
This would load a random image from image_1.jpg, image_2.jpg … to image_10.jpg
or
$images = array("cool_image.jpg", "nice_pic.jpg", "sunset.jpg");
$rand = array_rand($images);
<img src="http://www.mywebsite.com/images/<?php echo $images[$rand]; ?>" alt="" />
This would select a randow image from thoses specified in the $images array.
Date range :
<?php
if ((date('m') == 3) && (date('d') == 17)) { ?>
<img src="http://www.mywebsite.com/images/stpatrick.jpg" alt="" />
<?php } ?>
This would show an image for St Patricks
Specific posts or pages :
Related Posts:
- what the best way to include images from the template’s images folder?
- How to create a new theme from scratch?
- add image size still doesn’t work even after regenerating thumbnails
- I’m trying to add an image in my CSS
- How to automatically highlight syntax of code in a post?
- Creating Multiple Menus when using the TwentyTen Theme?
- Change Default Image HTML
- Archiving annual festival site
- What is the WordPress Pinecone sitting on top of? [closed]
- Selected template is not respected for home page in WordPress
- Copying post thumbnail to custom field
- Display Headings on Index page in different font sizes
- Migrating a website using custom image tags to use featured images instead
- how to stop a gallery slideshow
- Is there any way to modify images from a theme using the web interface?
- 1px black line appearing down right side of thumbnails (theme snaps) [closed]
- Featured images are cropped on index and post page
- Work on theme files on a server & browser preview before installing it
- How to change images size after theme modification?
- Create a child Theme or custom Theme
- Boldy theme – Regarding the images above the boxes
- How to insert a column (part of theme) in the middle of the content body?
- Using OOP in themes
- How can I allow the Editor Role to change Theme Settings?
- Am I allowed to license my WordPress theme under the aGPL
- Best way to include Bootstrap in WordPress
- How to remove search bar from a wordpress theme? [closed]
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Template for individual post designs
- Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?
- register_theme_directory and broken deploys
- switch a theme different per user role
- How to make alert for new version on theme options?
- Can we create a child theme for a premium child theme built on Genesis framework?
- Migrating October CMS to WordPress
- How to change the themes “Live Preview” url within the Appearance->Themes page?
- How do I apply my CSS to a theme page?
- How do you get thumbnails to show up in the admin edit post?
- How to get the post-ID in my plugin?
- Parallax WordPress theme without hardcoding – possible?
- Embedded Videos (PB) – Not Available
- Recommended Themes for a Developer-related Topics Blog?
- none of my css is working in my child theme
- Finding wordpress file in theme editor using the theme name
- Displaying a widget in sidebar only when no other widgets rendered?
- Upgrading from 2.9.4 to 3.0.x and with a custom theme
- Search form not finding content in template page
- Files empty after moving with FTP
- How to use one theme for multiple WordPress sites?
- Make multiple pages and set template/content on theme activation?
- How to transform a custom made static HTML website to a WordPress website [closed]
- Need to edit themes HTML code
- Newbie wordpress question re banner height
- How to add custom JS file in WordPress Child theme with get_theme_file_uri
- Adding the jQuery to my theme that already exists in WordPress?
- Interpretation and explanation of register sidebar
- Removing the references to the wp-content folder
- Cannot update a file for my theme
- Is there a way to serve different resolution images to different devices?
- Do all themes accommodate all features?
- How to reduce Header at the top of the page
- Custom fields not displaying on front end
- remove theme’s name from dashboard .. How?
- Change “published by”
- WordPress does not load most theme images
- Theme seems to be preventing me from adding a new page to my site
- WordPress margin issues
- 12 column grid layout
- Remove style id inline CSS in WordPress
- How to find file that placed a line in my header
- Where to find child themes?
- dynamic image path within a javascript file
- how to create a section inside a section with theme options customizer
- Warning: call_user_func() expects parameter 1 to be a valid callback
- theme continuous deployment from bitbucket to windows azure
- Changing themes on locally hosted webpages
- Changing admin Textarea to integrated WP editor
- Line break no working on theme
- What is the template file for topic layouts in bbPress?
- Style of a theme
- Orion theme (from theme forest) [closed]
- QA/Staging envirnoment for wordpress sites
- Showing wordpress theme demo at front end
- Diagnosing a connection reset problem
- WordPress with PageLines theme: how to change the background color of a page? [duplicate]
- Customising a theme
- Blog shows up without Theme/CSS styles
- Symbolic Links for themes – linking one theme to many wordpress installs
- Fatal error: Call to undefined function get_header() and BuddyPress [closed]
- A problem with functions.php file on my WordPress site
- hardened wordpress linux install
- which theme is this? [closed]
- JQuery Error in theme for .live is not a function [closed]
- WordPress Theme redirects to the Index page – Theme customizer problem
- How to assign posts to different themes? [closed]
- Using AJAX to Update WordPress Theme
- Help with Divi logo not appearing for 10s
- WordPress Theme: replace logo image with title site if file doesn´t exist on server
- How to clone a theme template from within WordPress? [closed]
- How to automatically load Google Fonts on pages only as they’re used?