• Resolved Aureola

    (@aureola)


    Hi,
    I’m wondering if anyone could tell me where I can find the template file that is used when a link in the Calendar widget is clicked? It’s the standard widget, used in my own theme (built upon a stripped twenty-twelve theme.)
    As it is now, the default page template is used (page.php), which is the one for the static home page. No other page should use this template. All other pages use a template called page_secondary.php, including the news/blog page, except when a user selects a specific blog post; then of course single.php is used.
    I would like the calendar links to use the page_secondary.php template but I don’t know where to do this.
    I thought it might be WP-INCLUDES/GENERAL-TEMPLATE.PHP but this file seem to be dealing with just the calendar widget itself; not it’s links.
    I’d be most grateful if someone could help me out.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The widget is styled via your theme – not via the core WordPress files.

    Thread Starter Aureola

    (@aureola)

    Thanks Esmi – always there to draw me out of the ditch I’ve buried myself in ??
    But if I haven’t styled it – at least not consciously – where would I do that? And how..?

    Thread Starter Aureola

    (@aureola)

    I’m wondering, maybe these links point to the so called “archive”?
    If so, would it help if I created a file called archive.php?
    And there tried to “tell” it to use the page_secondary template..? I’m so totally lost…

    Update: I think I’ve found the template file! It was of course index.php, which is the one used when there are nothing else! right? But if I create a file called archive.php, it would use this one instead?

    I have some other stuff I need to change that should only affect the archived blog posts, such as a reply-link for every post, so I guess the best would be to leave index.php as it is and just create the archive.php and do what I need to do there. Am I on the right track?

    would it help if I created a file called archive.php?

    That might help if the new file had a similar layout/formatting.markup as your page_secondary.php but remember that this will not be a Page template, so do not include the Page comment block at the top of the file.

    Thread Starter Aureola

    (@aureola)

    It did help! ??
    I just copied the template used for the News page (the blog).
    I’m not sure what you mean by this:

    remember that this will not be a Page template, so do not include the Page comment block at the top of the file.

    How is it not a page template? I’m a WP newbie so maybe I have the wrong terminology. It does behave very much like the rest of the page templates used by other pages on the site.

    I’m interested to sort this out because I would like to include a comment-link at the bottom of each blog post; both in the archive.php as well as in the home.php (the blog template) so that visitors of the blog could easily comment. I also want all comments to be visible under each of the blog posts – is it this that you do not recommend?

    Thread Starter Aureola

    (@aureola)

    Ah I think I get what you mean now!

    This row:

    /*
    Template Name: Archive-template
    */

    Shouldn’t be included, because if I do, then it shows up in the Meta-box of Templates in the admin panel – right? Which is of course unnecessary, because I never want my editor users to select this as a template for any page they ever create.

    There is nothing stopping me from adding a Reply-link / comments at the bottom of each posts then, if I understood you correctly. Many thanks again and sorry for being a little “slow”.

    Shouldn’t be included

    Correct!

    Thread Starter Aureola

    (@aureola)

    Great, thanks Esmi!
    So, to mark this as Resolved I repeat the answer to my question was:

    The template that is used by the links in the Calendar widget is archive.php. And when there’s no such file WP defaults to index.php. As is explained on this page: https://codex.www.ads-software.com/Template_Hierarchy
    (I did read this page; I just wasn’t sure of the connection with the Calendar widget links)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How can I change the template file used by Calendar Widget links’ is closed to new replies.