Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14516

    I have a blog with 20 categories for 20 cities. Each city has its own page that will have content (photo and video galleries) and post listings for its blog category. I created the first one dynamically in template builder, but it looks like I’d have to choose which category I’d like to appear in that template.

    Does this mean I’d have to create 20 nearly identical dynamic templates? Or is there a way I can utilize WordPress code like this in the dynamic template builder?

    <?php query_posts('cat=14'); ?>

    You can see the very barebones site at http://yourhotspots.com/test/ The city pages are under Episode Guides.

    Thanks!

    Heather

    #83766

    Hey!

    You could use a custom field to save the category id value: http://codex.wordpress.org/Custom_Fields

    Best regards,

    Peter

    #83767

    Dude, can you explain a bit more for me, please?

    Thanks!

    Heather

    #83768

    Actually some custom work on your end is required here and I can’t provide a working solution but the idea is to eg duplicate the blog element code in includes/helper-template-dynamic.php and to add a new element options field to includes/admin/register-admin-dynamic-options.php (based on the blog element) and then you need to the add the http://codex.wordpress.org/Function_Reference/get_post_meta function which overwrites the default category array.

    #83769

    That definitely points me in the right direction, Dude. I’ll work on a development server and see if I can get this to work (after ‘breaking’ it a few times, of course! haha).

    Again, I appreciate it!

    Heather

    #83770

    Good luck with it! Always interesting to see the results of modifying some of the core functions to get additional functionality with the themes :)

    Regards,

    Devin

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘WordPress Code in Template Builder Section?’ is closed to new replies.