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

URL rewrite before template_redirect called

So the problem was redirect_guess_404_permalink was detecting a 404 error and ‘guessed’ /members/blog to be /blog My hacky solution was to hook into the status error check (Stop WordPress from “guessing” redirects for nonexistent URLs) and if URL parts match then unset the guessed solution function blog_no_redirect_guess_404_permalink( $header ){ global $wp_query; if( is_404() ) { … Read more

custom template only for content

You can’t override template parts. Even if you could, you would have no way of knowing what template part you’d need to replace. A theme is only required to have an index.php file and there are no restrictions or naming convention for template parts. Your options are to create a full template and leave it … Read more

Access methods in plugin template

Normally not (it depends on what part of the plugins code you want to use and how the plugin initializes itself in the context in which you want to do it), the main plugin files are loaded as part of the wordpress boot process and the convention is that they will load the other files … Read more

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