WordPress.org

Ready to get started?Download WordPress

Forums

How to change a theme file path? (5 posts)

  1. Marco Panichi
    Member
    Posted 1 year ago #

    I've created a custom type 'Portfolio'. Now the structure of my theme folder is:

    mytheme/
    	(other files and folders)
    	content-portfolio.php
    	single-portfolio.php
    	custom-types/
    		portfolio/
    			portfolio.php

    I'd really like to transform it into this one:

    mytheme/
    	(other files and folders)
    	custom-types/
    		portfolio/
    			content-portfolio.php
    			portfolio.php
    			single-portfolio.php

    I ask to you:
    - it is a good idea?
    - how can I reach this?

    Thank you for every suggestions

  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    All files of one theme will be in the theme's folder unless subfolders have been assigned by the theme designers.
    Is it a theme developed by you?

  3. Marco Panichi
    Member
    Posted 1 year ago #

    Hi Krishna, thank you for the reply.

    Yes, I've developed the theme. How can I assign the subfolders?

  4. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Sorry, I can't tell you how exactly you can do that. But these resources may help:
    http://codex.wordpress.org/Theme_Development
    http://codex.wordpress.org/Theme_Development_Checklist
    http://codex.wordpress.org/Designing_Themes_for_Public_Release

    Also see how some of the themes with subfolders as you want have been structured.

  5. Marco Panichi
    Member
    Posted 1 year ago #

    I really appreciate your help....thanks!

    I digged those links lots of time, but I've never found something to solve my problem.

    Maybe I can do this:

    archive.php

    if( get_post_type()=='portfolio' )
    {
        include( 'custom-types/portfolio/archive-portfolio.php' )
    }
    else
    {
        // here the content of archive.php
    }

    Yes I know, it's not so elegant...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags