Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6146541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:57:51+00:00 2026-05-23T18:57:51+00:00

I am building a free WP theme but know next to nothing about PHP.

  • 0

I am building a free WP theme but know next to nothing about PHP. I don’t know what to put around this code and would greatly appreciate if somebody could put the correct PHP tags around it, as telling me what to put is a bit like speaking Latin to me. I tried putting <?php at the beginning and ?> at the end but it didn’t work:

if ( has_post_format( 'aside' ) {
  //  aside format post content here
} else if (has_post_format('gallery')) {
   // stuff to display the gallery format post here
} else if (has_post_format('link')) {
   // link format post content here
} else if (has_post_format('video')) {
   // video format post content here
} else if (has_post_format('audio')) {
   // audio format post content here
} else if (has_post_format('status')) {
   // status format post content here
} else if (has_post_format('chat')) {
   // chat format post content here
} else if (has_post_format('quote')) {
   // quote format post content here
} else if (has_post_format('image')) {
   // image format post content here
}else {
   // code to display the normal format post here
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:57:52+00:00Added an answer on May 23, 2026 at 6:57 pm

    Put <?php in front of every line that does not hold any code (thus starts with if or }),
    and end those lines with ?>.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Feel free to skip the first two paragraphs :) I know this goes against
This might not appear like a programming question, but inherently deals with code. I
Is there any free set of forms, icons, styles, images, etc for building web-based
building a site using PHP and MySQL that needs to store a lot of
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I'm building a program in C++, using SDL, and am occasionally receiving this error:
I am looking for a free static checker for C99 code (including GCC extensions)
I am building an installer for my windows app and have done this through
I'm having to start building the architecture for a database project but i really
I've found a lot of different examples on the internet, but nothing seems to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.