• Hi all. I’m trying to set my images to automatically center in a particular category of posts, but I’m no good with php. Can you help?

    Here is the code in my theme:

    <?php tfuse_get_image(135, 190, 'img', PREFIX.'_post_image', '', false, 'blog_img'); ?></a>

Viewing 1 replies (of 1 total)
  • you might be better able to do this with css – particular, if your theme uses post_class()

    .post.category-particular img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    }

    alternatively, you need to find the code of the function that outputs the image
    function tfuse_get_image()
    and integrate a
    class="aligncenter;"
    into it, possibly using a concitional statement to do this only in the particular category;
    http://codex.wordpress.org/Function_Reference/in_category

Viewing 1 replies (of 1 total)

The topic ‘Centering an image in php’ is closed to new replies.