WordPress.org

Ready to get started?Download WordPress

Forums

Template settings (11 posts)

  1. SCO7TY
    Member
    Posted 2 years ago #

    I have copied a template from my theme, basically copied page-blog template and called it page-blog2 and changed a few things.

    The problem i have is that when i select the template the page template settings underneath diappear! I'm assuming i need to edit something somewhere to include the page-blog2 template so that i have the settings but i cannot find where,

    Anyone know?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. SCO7TY
    Member
    Posted 2 years ago #

    that baffled me pretty quickly! Seems quite complicated...

  4. SCO7TY
    Member
    Posted 2 years ago #

    All i want to do is change the category of posts, is there a simple way to do that in the template file? If so where do i change it?

  5. SCO7TY
    Member
    Posted 2 years ago #

    Something here maybe?

    $blog_cats = isset( $et_ptemplate_settings['et_ptemplate_blogcats'] ) ? (array) $et_ptemplate_settings['et_ptemplate_blogcats'] : array();
    $et_ptemplate_blog_perpage = isset( $et_ptemplate_settings['et_ptemplate_blog_perpage'] ) ? (int) $et_ptemplate_settings['et_ptemplate_blog_perpage'] : 10;
    ?>
  6. SCO7TY
    Member
    Posted 2 years ago #

    This is the whole template, can someone please tell me where i can change the blog category

    [ Code moderated. For more than 10 lines of code please pastebin.com instead. ]

  7. SCO7TY
    Member
    Posted 2 years ago #

    Read through the first link over and over and i cant do it! Is there really no one on here that cant help?

  8. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    I have copied a template from my theme, basically copied page-blog template and called it page-blog2 and changed a few things.

    Without knowing the before/after state of the template file, it will be nearly impossible to provide any specific support regarding changes that you've made.

    The problem i have is that when i select the template the page template settings underneath diappear! I'm assuming i need to edit something somewhere to include the page-blog2 template so that i have the settings but i cannot find where,

    What "options"? What does the page template do? What did it do originally, and what do you want it to do differently that prompted you to change the code?

  9. SCO7TY
    Member
    Posted 2 years ago #

    Ok i'll try and explain as best as i can.

    The original template was just a blog template, i have template settings which allow me to choose which category of posts i want to show on that page.

    The new template is an exact copy but then edited it a bit so that it would show an image at the top of the page for the title, that's basically the only change. But on this new one when i select the template i dont get the settings, probably becuase it has to link to another file somwhere, i dont know!

    I dont really need the settings but by default the blog lists all posts, i just want it to list a certain category. Is there somewhere in code i can edit to change the category of posts?

  10. SCO7TY
    Member
    Posted 2 years ago #

    This is the original template - http://pastebin.com/q2KPPf8h

    This is the template i modified - http://pastebin.com/B1Riavmq

    [ Please do not bump, that's not permitted here. ]

  11. SCO7TY
    Member
    Posted 2 years ago #

    Can i put the following code in somewere to select blog category?

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'antiquarianism, championship', // Change these category SLUGS to suit your use.
    	'paged' => $paged

Topic Closed

This topic has been closed to new replies.

About this Topic