Okay
  Public Ticket #237977
Custom Template from Default Template
Closed

Comments

  • Minter started the conversation

    I went to CSS-Tricks, my go-to web forum for anything code related, to ask about adding a custom class to specific pages. I want all of my galleries (and there'll be a lot of 'em) to be formatted exactly the same way. So, if I were to say have the word "gallery" applied as a class to each gallery page, then I could target all of my galleries in one fail swoop while writing my CSS. I was personally looking for a way to do it with pure PHP, but someone suggested I create a child template called "gallery." I searched Google for any instructions on creating child templates, but all that came up were articles discussing "child themes," which isn't what I want. So, figuring that the "Default Template" is probably being running off of the index.php file, I copied that code and added the code necessary to make it a separate template and used FileZilla to add the custom template to the theme. I figured that would do the job, and the page loads just fine, but it looks nothing like it did when I had the "Default Template" selected. Any and all help will be muchly appreciated.

  • Minter replied

    And I tried using the "Portfolio" template, but I much prefer the way it looks when you use the "Default Template" and use the Visual Composer to insert a full-width portfolio.

  •  8,470
    Tahir replied

    Hey Minter!

    Please use the attachched child theme and place a new page template in it and adjust as per you liking. 

    All the Best,

    -T


    ThemeNectar Support Team 

  • Minter replied

    That helps me somewhat so I don't mess with the actual theme, but I still need to know which file is being used for the "Default Template." I'm simply trying to replicate the default template, give it the name "gallery," and then use the renamed template for my galleries so all of them have a class of "gallery" in the output for the body.

  • Minter replied

    This is what it looks like if I use index.php as a base for my gallery template, which is horrendous in comparison to the second image, which is using the Default Template. But the default template is used for the majority of my pages and I would like to be able to target my galleries specifically.

  •  997
    ThemeNectar replied

    Hey Minter!

    The default page template is actually page.php inside of the theme directory. The index.php is only used for the blog/archive displays.

    Cheers :)

  • Minter replied

    Awesome. Thank you. Duplicated page.php and added the template code to the top, renaming it to "gallery," and it works like a charm!