• I’ve made post formats before on other themes and custom (ground-up) themes, but I don’t understand how this works for Twenty Sixteen, which I’m doing a custom modification of right now. (note: I’m not an expert or trained — I learned WordPress and code myself from YouTube and other tutorials, and trial and error).

    I want to have a “link post” for Twenty Sixteen, but I don’t understand where to put it etc. The theme already has all the formats set up, and the options display in the post editor, but when I select link and upload a content-link.php file, it doesn’t change the display of the post.

    Any thoughts or suggestions? Or can you point me toward a tutorial?

Viewing 4 replies - 1 through 4 (of 4 total)
  • when I select link and upload a content-link.php file, it doesn’t change the display of the post.

    where to did you upload the file?
    are you aiming to change the display of the single post view?

    generlly, the theme is calling the template parts in a folder;
    see code for example in index.php:

    get_template_part( 'template-parts/content', get_post_format() );

    i.e. for posts in index and archive pages, you need to add your content-link.php into the folder /template-parts/ or recreate a corresponding structure in a child theme (recommended rather than editing the theme directly).

    the single post view does not distinguish postformats any more – there is only one content-single.php
    called by this line in single.php:

    get_template_part( 'template-parts/content', 'single' );
    Thread Starter ordresser

    (@ordresser)

    Hi, yes, correct, I want to change the display of the single post view.

    I have uploaded a content-link.php (with code on it) to twentysixteen-child/template-parts, and then I select “link” in the post format options (already a function in twentysixteen, as you know).

    No change to the single post, though.

    Am I the only one having this issue?

    I’ve tried it on 4 of my websites, all of which I’ve previously used formats on past themes. But none of them change.

    I don’t understand what you mean by your second explanation:

    the single post view does not distinguish postformats any more – there is only one content-single.php …
    called by this line in single.php:

    get_template_part( ‘template-parts/content’, ‘single’ );

    Are you saying that TwentySixteen is not built for postformats like “link” “video” etc? If it is build that way, how can the line of code in question in single.php be changed to enable formats?

    Thanks

    you would need to change this code in single.php (in a child theme):

    get_template_part( 'template-parts/content', 'single' );

    for example to:

    get_template_part( 'template-parts/content-single', get_post_format() );

    and then create for example your /template-parts/content-single-link.php with your link specific code.

    same for any other postformats you would want to display differently as single post.

    Thread Starter ordresser

    (@ordresser)

    Thank you, that works. NOTE: Necessary (at least on mine) to do in ftp. If you do it in WordPress theme editor, you might get this message (I did):

    Fatal error: Call to undefined method WPaaS\Cache::flush() in /home/content/fsgdsew5vdgs/82/356356345/html/wp-content/mu-plugins/gd-system-plugin/includes/admin/class-file-editor.php on line 124

    Thanks again. This question is resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to make a post format in "Twenty Sixteen"?’ is closed to new replies.