Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I finally figured out my problem.

    I had my blog on a subpage (site.localhost/writing), but I hadn’t actually configured WP to use a static front page with the blog on another. Once I did that it started working.

    Edit: Maybe not. Only the latest post is processed correctly–anything after is not, and viewing single posts are not correctly processed either. Back to the drawing board, I guess…

    Hi there. I’m having a similar problem. It seems like the normal hooks aren’t firing, and when I try to call fn(‘the_content’) I get no output from it. This has caused two side effects: Shortcodes aren’t being evaluated within the post content, and when I’m editing a post, if I click on the “preview” button, it doesn’t load my changes–only what’s already been saved.

    page.php

    <?php
    
    global $paged;
    if (!isset($paged) || !$paged) {
    	$paged = 1;
    }
    
    query_posts("post_type=post&posts_per_page=3&paged={$paged}");
    
    $context               = Timber::get_context();
    $context['page']       = new TimberPost();
    $context['posts']      = Timber::get_posts();
    $context['pagination'] = Timber::get_pagination();
    
    Timber::render(["page-{$context['page']->post_name}.twig", 'page.twig'], $context);
    
    ?>

    From there it loads up page-writing.twig, which is my loop for displaying recent posts. There’s a little more to it than this, but this is the relevant part. Might be worth noting that the fn(‘post_class’, …) does work as expected, even though fn(‘the_content’) yields no output.

    The following code successfully gives me output using {{p.content}}, but doesn’t evaluate shortcodes etc.

    {% for p in posts %}
    
       {# Post article begins. #}
       <article {{fn('post_class', 'blog-listing')}}>
    
          {# Post metadata eg. datetime and comment info. #}
          <header class="post-meta">
             <h3 class="post-title"><a href="{{p.permalink}}">{{p.title}}</a></h3>
    
             <span class="post-meta">
                Posted on {{p.post_date|date}} ·
                <a href="{{p.permalink}}#comments">
                   {% if p.comment_count == 0 %}
                      No comments
                   {% elseif p.comment_count == 1 %}
                      1 comment
                   {% else %}
                      {{p.comment_count}} comments
                   {% endif %}
                </a>
             </span>
    
          </header>
    
          {{p.content}}
    
          ...more...
    
       </article>
    {% endfor %}

    Any ideas?

    WP 3.9.2, PHP 5.5.9, installed Timber through plugin settings in WP dashboard.

    (Disregard, posted in the wrong topic!)

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