• Resolved riikk

    (@riikk)


    Hi,
    i am starting to use timber and twig, and still quite new to both.
    i have set up a page, using wordpress together with timber for two pages comin out of wordpress and two static pages build with twig.

    now maybe i oversaw something, but i want these two wordpress pages use different templates. i cannot find the dropdown one normaly has in wordpress.

    I want that page A only shows post form category A,
    and Page B only shows post form category B.
    how is it done, usind different templates?

    I use the timber-starter-theme. do i need a different template.

    thanks a lot.

    https://wordpress.org/plugins/timber-library/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author jarednova

    (@jarednova)

    Hi @riikk, I’d love to help but I’m having a very difficult time understanding the issue.

    Can you please provide a clear explanation of

    a) what you expect to happen
    b) (compared to) what is actually happening
    c) code you are using, and which file it is in (page.php, category.php)
    d) screenshots (for example, “dropdown one normally has in wordpress’ could mean many many things)

    Thread Starter riikk

    (@riikk)

    hi jarednova,
    thanks for your feedback and sorry for my confusing answer.

    actually now the problem is almost solved. I was looking for the dropdown to select a template for a certain page.
    First it was not there, but after i changed to another theme and back to the timber-theme the dropdown appeared suddenly.
    see what dropdown i mean: http://hh.dropmark.com/182907/3370770

    Now i am stuck with getting posts of a certain category.
    According to this: https://github.com/jarednova/timber/wiki/TimberTerm
    i get all the Categories Listed, but not the articles.

    Plugin Author jarednova

    (@jarednova)

    I think what you’re looking for instead is…

    $posts = Timber::get_posts(‘cat=14’);

    …or…

    $posts = Timber::get_posts(‘category_name=news’);

    Timber::get_posts will take all the params for categories you find here:

    http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters

    … and any other parts of WP_Query

    Thread Starter riikk

    (@riikk)

    thanks.
    and i put this in the index.php file (or the relating .php file of the template) ?

    do i have to delete something instead? because nothing changes.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Twig Templates’ is closed to new replies.