0

While I was on vacation, a contractor has done some work on a charity website which I created and own as a volunteer. He has added a 'landing page' www.mydomain.com/xxxxx and has a landing page consisting of HTML and no php in the theme directory named 'landing.php'. There does not appear to be a page named xxxxx and I don't believe that there is any plugin helping with the mapping of url to page template. Maybe I'm being stupid and naiive on this but can anyone enlighten me as to how an access to www.mydomain.com/xxxxx gets mapped to use the landing.php template. I thought that I knew Wordpress pretty well but this very basic question has me completed stumped. I've been through pretty much all of the options on the dashboard (including permalinks) but can't see any obvious mapping mechanism.

Can anyone tell me where my blind spot might be, please ?

From Settings->Reading

Front Page Displays : Your Latest Posts

Not sure any of the other items are important.

Landing.php is here

<?php

/**
 * Template Name: Landing Page
 * Description: A Page Template that is Landing Page
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 * Created By : Sanjay Dhameliya
 */
?> 
3
  • This question is impossible to answer as-written. Please edit your question to include your site's front-page settings in Settings -> Reading. Also, please post the landing.php file code. Oct 9, 2013 at 17:30
  • "Front Page Displays : Your Latest Posts" - the contractor has apparently done something non-standard, or that would at least be set to "a static page". Joy. Now, it's just a matter of tracking down what's been done. Does your Theme have a front-page.php template file? Oct 9, 2013 at 17:52
  • Yeah, after seeing landing.php, the only thing relevant is the phpDoc header. Also: please disable all Plugins and switch to a default Theme (e.g. Twenty Twelve). Verify if the front page properly displays the blog posts index. Then re-activate Plugins one-by-one. Oct 9, 2013 at 17:56

1 Answer 1

0

I have done something similar by adding a rewrite rule

add_rewrite_rule( "users", "index.php?fea_users", 'top');
add_filter( 'query_vars', array($this, 'query_vars') );
add_filter( 'template_include', array($this, 'template_include'), 1, 1 );
function query_vars( $query_vars ) {
    $query_vars[] = "fea_users";
    return $query_vars;
}
function template_include( $template ) {
    global $wp_query;

    if ( isset($wp_query->query["fea_users"]) ) {
        // return any php file here
        return $this->common->get_template( 'page-template.php' );
    }

    return $template;
}

I have a url looking like www.mydomain.com/users and the actual code is located in page-template.php

Another method, after your updated post, Is to create a normal page and associate it with a custom template. The page itself doesn't need any content, it's only there for the slug (permalink), it's associated php file can display anything.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.