permalinks of subcategory and posts

use the following code should get you through your problem. just pass the id of parent category in $term_id variable <?php $term_id = ; // id for the parent category $taxonomy_name=”category”; $termchildren = get_term_children( $term_id, $taxonomy_name ); foreach ( $termchildren as $child ) : $term = get_term_by( ‘id’, $child, $taxonomy_name ); ?> <h3><a href=”https://wordpress.stackexchange.com/questions/191436/<?php echo … Read more

Two urls for one website

Move the wordpress site to his new domain. Make sure everything is working, hint: update all url’s using Velvet Blues Plugin Point the old domain to a directory containing only two files: A file named “index.php” containing: <?php $goto = $_SERVER[“REQUEST_URI”]; header(“HTTP/1.1 301 Moved Permanently”); header( “Location: http://new-domain-name.ch” . $goto ); ?> And a file … Read more

Permalinks – Archives

Look at this section (excerpt): Day and name – An example of the day and name based structure is http://www.sample.com/2008/03/31/sample-post/ Month and name – An example of the month and name based structure is http://www.sample.com/2008/03/sample-post/ Numeric – An example of the numeric structure is http://www.sample.com/archives/123 Those are archives– specifically the first two are “date” archives. … Read more

403 Forbidden Error on subdomain

So this issue had to do with File permissions. I believed that I had already checked into this to make sure that permissions were set properly, but I must have erred. I went to the subdomain folder ‘staging’ which contains my WP install and turned on User ‘read’ and ‘write’ permissions, which were inactive. So … Read more

Automatically remove repeated words in slug

According to your example ‘example.com/wordpress-how-to/how-to-create-a-child-theme-in-wordpress/’ search  = wordpress-how-to subject = how-to-create-a-child-theme-in-wordpress/ this code removes all the words from the subject found in search term. for more details check “Avoiding infinite loops” from save_post function modified_slug( $post_id ) { // If this is a revision, get real post ID if ( $parent_id = wp_is_post_revision( $post_id ) … Read more

single.php being ignored, going straight to attachment.php

OK, well, I’ve put the search for a proper answer on hold and instead cobbled together a ‘for now’ solution. First, in the referring page that is linking to the individual Post page, I’ve added this: $theid = $post->ID; echo “<li><a href=””; the_permalink(); echo “?id=” . $theid; echo “”>”; echo “blah”; echo “</a>”; So, on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)