Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter nathanielgivens

    (@nathanielgivens)

    Thanks, setzer. That did the trick.

    Thread Starter nathanielgivens

    (@nathanielgivens)

    So… who can I bug about getting the icon in the font?

    Thread Starter nathanielgivens

    (@nathanielgivens)

    (Well, you might be a gentlelady, but you get the picture. No gender-assumption was intended!)

    Thread Starter nathanielgivens

    (@nathanielgivens)

    wpismypuppet-

    You, my new friend, are a gentleman and a scholar! It looks terrible when I remove the .titlearea, but it works! That’s stupendous!

    I may have some questions later about how to get the formatting just right, but the question I had here was how to get the post-format working at all, and you have graciously helped me out.

    Thanks so much!

    Thread Starter nathanielgivens

    (@nathanielgivens)

    wpismypuppet-

    Thanks again for taking the time to help out a n00b. So the

    <?php post_class(); ??

    stuff is what I read about from this tutorial: https://wprocks.com/2011/09/25/what-are-post-formats-how-do-we-put-it-to-use/

    Specifically:

    Styling Posts differently according to the post format selected
    Once we added the support for post formats, the user can select a post-format for a blog post.
    Then the theme has to style the posts differently.
    For that, we make sure we add post_class() method to the article tag within the loop.
    Something like

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    Then we will get something like this for each article.

    <article id="post-20" class="post-20 post type-post status-publish format-standard hentry category-uncategorized">

    Just like this, we would get format-aside, format-image or format-gallery, depending on the post-format assigned to the post.
    Now when we want to style things differently depending upon the post-format, we can add style definitions for these class names in our style.css

    So, I went to do that and put it in the loop.php file (I don’t know why Ari has one of those), but when I went to do that I found that the code was already there:

    <?php /* Start the Loop. */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
    
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    So that snippet shows the start of a while-loop and then the first line is something involving the post_class() method, so when I saw this, I thought “I guess I don’t need to add it again…”

    But maybe I was wrong? Is loop.php the place where I should be adding this post_class() method, and is the current code (copy-pasted above, which obviously isn’t working) actually doing something else?

    Thread Starter nathanielgivens

    (@nathanielgivens)

    wpismypuppet-

    I don’t have any problem getting the Format box to show up. I’ve had that working for weeks. ?? I have dutifully created a couple of posts with varying post formats and–in the Dashboard–they are correctly displayed as “Standard”, “Aside”, and “Link”. (That’s all I have so far.)

    The problem is that when I actually go to my site (difficultrun.nathanielgivens.com) there is no indication at the front-end of any post-format.

    Based on the style.css code I copy-pasted, they should each have a customized icon, but there are no icons. There’s no different whatsoever between the posts that are Standards and the Aside and Link posts that I’ve created.

    In short: I can select the post-formats when I write a new post, but it has no effect whatsoever to anyone viewing my blog, and that’s what I’m stuck on.

    Thanks again for taking the time to help me.

    Thread Starter nathanielgivens

    (@nathanielgivens)

    Thanks for the really rapid replies, wpismypuppet and Drew. I tried adding the conditional code snippet (the one suggested by wpismypuppet) in the functions.php file. I added it inside the setup() method (specifically: function ari_setup()). The good news is that nothing *broke*. The bad news is that I still have no post-format.

    Right now I’ve got a few tests posts that each have a different post-format applied. I also have some basic custom formatting in style.css:

    /* CUSTOM FORMATTING FOR POST-FORMAT
    --------------------------------------------- */
    .format-aside .titlearea { background:url(images/aside.png) no-repeat left top;}
    .format-audio .titlearea { background:url(images/audio.png) no-repeat left top;}
    .format-chat .titlearea { background:url(images/chat.png) no-repeat left top;}
    .format-standard .titlearea { background:url(images/standard.png) no-repeat left top;}
    .format-gallery .titlearea { background:url(images/gallery.png) no-repeat left top;}
    .format-image .titlearea { background:url(images/image.png) no-repeat left top;}
    .format-link .titlearea { background:url(images/link.png) no-repeat left top;}

    Finally, I do have the images in the appropriate folder ( wp-content\themes\ari\images ). So, if post-format was working, I’d see the custom icons on my test posts, but I don’t.

    What should I try next?

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