CPT category hierarchy

If you’re trying to create a hierarchal structure with regards to custom post types you’ll need to register a custom taxonomy on a more abstract version of your desired post type. For example instead of naming your custom post type cars name it vehicle. You could then a register a hierarchical taxonomy with register_taxonomy(). In … Read more

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

Remove trailing slash from previous_posts_link()

There’s two problems here: previous_posts_link() echoes the link, rather than returning it. previous_posts_link() returns the full HTML of the link, including <a href=””> etc. The problem with #1 is that for you to be able pass the result of a function to another function (such as rtrim()) as an argument, that function needs to return … Read more

URL / Templating system advice [closed]

Do you have: A category somecategory defined? Posts categorized with somecategory? Some default else: content in the Loop in category.php? I suspect the URL is returning a 404, and WordPress is simply serving up the root URL, because it has no content to serve up from category.php. EDIT You don’t need to do anything special … Read more

Start post pagination at 0 instead of 1

The ../page/X structure ties to pagination, not to post names. I’m sure you could change them but I’m not sure how deep the effects of the change would be. Have you thought about an alternate solution? Name each post your chapter name Forward Chapter 1 Chapter 2 Add a plugin that adds previous / next … Read more

Permalinks settings

I’m not able to visit either link successfully. I get a redirect loop error: ERR_TOO_MANY_REDIRECTS Changing the URL of your website in Settings > General > Site URL is not enough unfortunately. You will still have your post content with your sub domain URL (clasificados.example.com) causing your website to not load properly. Once you’ve downloaded … Read more

Retrieve post ID from “querying” URL

Try This Code $latest = new WP_Query( array ( ‘post_type’ =>’your-post-type-name’, ‘post_status’ =>’publish’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 3 )); while ( $latest -> have_posts() ) : $latest -> the_post(); echo the_ID(); endwhile;