Skip to content

Page template not getting set. #44

@rnschmidt

Description

@rnschmidt

I'm using the following code to create a new wordpress page. The page is being created successfully, but the template isn't getting set. I've tried setting new_page.template equal to both the file name of the template as well as the name of the template.

    new_page = WordPressPage()
    new_page.title = state_name + " Market Data"
    new_page.template = "page_marketdata.php"
    new_page.slug = state_name
    new_page.parent_id = '216' #NOTE: Make sure you change this for live site!
    new_page.content = raw_html_page
    new_page.post_status = 'publish'
    wp.call(posts.NewPost(new_page))

Here is the output of pages.GetPagesTemplates:

{'Blog': 'page_blog.php', 'Default': 'default', 'MarketData': 'page_marketdata.php', 'Archive': 'page_archive.php', 'Landing': 'page_landing.php'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions