Posts Loops To Display Specific Posts Inside Page Template?

Here’s a (rudimentary) page for a loop I made in a webapp on WP a long time ago. I just upload this, create a page, and select “Updates Page” from the page template, and it loads in the 5 posts from the WP_Query() results. If you want to load 5 EXACT posts, just replace your … Read more

Why my htacess rewrite return 404?

I am assuming that the stuff in “def/products” is not handled by WordPress. Try reversing the index.php and abc/products rules, like so: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^abc/products-(.+)$ def/products-$1 [R=301,L] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> .htaccess is read and executed … Read more

Adding a content rating system

Custom field will do the task. On the post page there’s nothing to do great, just create a Custom Field called agerating or age-rating. Authors will enter the value of the field according to their content with G/PG/R/X. Then at the frontend, edit single.php. Use this code inside the loop to retrieve the rating value: … Read more

Adding a post to a page

Well, if you just want to add specific Post’s content/title/other stuff to specific Page, You can just use get_post() function. But Your formulation of question very vague.

Theme layout for home page [closed]

To the extent that this question is WordPress-related, here’s what you need to know: Start with a file named index.php. Give that file the following markup: <?php get_header(); get_template_part( ‘loop’ ); get_sidebar(); get_footer(); ?> The get_header() template tag will include a file named header.php. The get_template_part( ‘loop’ ) template tag will include a file named … Read more

Show div based on custom meta value

Then you need a filter on the_content. function add_conditional_div($content) { global $post; $meta_field = get_post_meta($post->ID, ‘your-field-name’, true); if (1 === $meta_field) { $content .= ‘<div>whatever</div>’; } return $content; } The 1 value, of course, is whatever should match your meta_field. http://codex.wordpress.org/Function_Reference/get_post_meta http://codex.wordpress.org/Function_Reference/the_content You could also edit your theme files directly or make a child theme. … Read more