Create a slug for a page in WordPress

The custom permalink you will most likely want to use is /%postname%/ Which will get the structure that you show above. (mydomain.com/about, mydomain.com/home) If you want to edit the slug, it’s right underneath the title of the post (“Permalink”), click edit.

Modifying WP URL handing code?

I ended up solving this with a little bit of code (in the form of a plugin): if(isset($_GET[‘state’]) OR isset($_GET[‘city’])) { $url = explode(“https://wordpress.stackexchange.com/”, $_SERVER[‘REQUEST_URI’]); $url = end($url); $_SERVER[‘REQUEST_URI’] = “https://wordpress.stackexchange.com/” . $url; } This code in essence removes the “/arizona/” or “/arizona/phoenix/” from the REQUEST_URI global variable and replaces it with “https://wordpress.stackexchange.com/”, which then … Read more

Why is home page content not displaying with this rewrite rule?

I suppose you’ve forgotten the QSA directive, to add properly the query string: RewriteEngine On RewriteBase / RewriteRule ^(\w+)/$ /index.php?state=$1 [QSA,L] RewriteRule ^index\.php$ – [QSA,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [QSA,L] Tell me if it works, and if not, I’ll do my best to answer. Two hints: Please try to use … Read more

WP_Query and help with the loop for magazine front page

There is no reason to need 2 loops or to alter the query in any way if your are just showing the 9 most recent posts. You can use a loop counter to create the extra divs you need. <div id=”featured”> <?php $count = 0; if (have_posts()) : while (have_posts()) : the_post(); $count++; if ( … Read more

PHP variables in a post?

By default, PHP is stripped out of the posts content. You can use this plugin to aleivate this: http://wordpress.org/extend/plugins/exec-php/ This will give you a quick, easy fix to be able to do it the way you are trying to. I would suggest reading http://codex.wordpress.org/Custom_Fields for the more proper way to do this though.

making my own “related pages” / “pages you might like” section

Function Reference/get the tags « WordPress Codex Class Reference/WP Query « WordPress Codex#Tag_Parameters add some code like this to content-single.php of your child theme of Twenty Eleven: $tags = array(); $posttags = get_the_tags(); if( $posttags ) : foreach( $posttags as $tag ) { $tags[] = $tag->term_id; } $related_query = new WP_Query( array(‘tag__in’ => $tags)); if( … Read more

WordPress custom post type and taxonomy

As per Anand’s comment, something like this should work. <?php get_header();?> <?php $args = array( ‘post_type’ => ‘Video’); $loop = new WP_Query( $args ); $old_term = null; while ( $loop->have_posts() ): $loop->the_post(); $fg = get_the_terms(get_the_ID(),’category’); foreach($fg as $term): if ( $old_term === null || $old_term != $term ): $old_term = $term; ?> <h2><?php echo $term->name; … Read more