To change the PHP-FPM process umask to create directories with certain permissions you can set it temporarily using the below.
<?php
$old = umask(0);
mkdir("/path/to/my/dir", 0775);
umask($old);
To change the PHP-FPM process umask to create directories with certain permissions you can set it temporarily using the below.
<?php
$old = umask(0);
mkdir("/path/to/my/dir", 0775);
umask($old);
To display a specific post by post ID, add the following code to your WordPress template file.
<?php //Select specific post ID $post_id=256; //To display post title echo '<h1>' . get_post($post_id)->post_title . '</h1>'; //To display post content echo get_post($post_id)->post_content; ?>
Tested with WordPress 3.3
You can place the following code in one of your theme’s template files to list a particular amount of posts from one of your site’s catagories.
<h2>Last 5 Tutorials</h2> <?php query_posts('category_name=tutorials&showposts=5'); ?> <?php while (have_posts()) : the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> <?php endwhile; ?>
Tested with WordPress 3.3