Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här addar du ett användargränssnitt för post format i WordPress 3.5

Post formats introducerades i WordPress 3.1 för att erbjuda mikrobloggfunktionalitet i WordPress. Trots att det finns där har de flesta Beginnare ingen aning om hur man använder det. Anledning: Eftersom det ej är lika framträdande som på Tumblr. WordPress har ett användargränssnitt för att publicera ett inlägg i olika format men den lilla metarutan med radioknappar kan förbättras. Alex King, en välkänd WordPress-utvecklare och författare till plugins, har tillsammans med sitt team på CrowdFavorite arbetat med att tillhandahålla en lösning på detta. Han utvecklade ett användargränssnitt för post format för att inkludera i sina egna projekt och var vänlig nog att släppa den koden till samhället. I den här artikeln visar vi hur du addar UI för Post Formats i WordPress 3.5 med hjälp av Post Formats UI tool.

Vad är Post Formats?

Post format erbjuder en metod för styling av ett specifikt inlägg på olika sätt. Genom att använda den här funktionen kan du ange visnings ”format” för ett specifikt post. Den här funktionen förstorar mikroblogg-aspekten av WordPress genom att lägga till format som gillar videor, länkar, images, ljud, citat, statusar etc. (mycket likt Tumblr).

Post format är beroende av ditt theme, så du kanske eller ej ser dessa i din WordPress dashboard. Det standardgränssnitt som tillhandahålls av WordPress för att välja ett post format när du skriver ett post ser ut så här:

Post Formats Radio Button User Interface

Installera användargränssnitt för post format

Gå till Post Formats UI-projektet på GitHub. Click on the zip button to download the files in the repository.

Download Post Formats UI plugin from GitHub

Gå till Plugins ” Add New ” Upload i WordPress admin area. Tryck på knappen Choose file och välj den zip-fil som du har downloadat. Tryck på knappen Installera nu. När tillägget har laddats upp utan problem klickar du på länken Activate Plugin.

Hur Post Formats UI fungerar

När det är aktiverat ändrar pluginet ditt post edit area genom att lägga till de tillgängliga post formaten som flikar högst upp. Nu kan du växla mellan att skriva ett post, citat, notis eller gallery. Om du klickar på tabben för ett annat postformat justeras resten av postredigeringsområdet för det vissa postformatet. Om du till exempel klickar på Status döljs fältet Rubrik för inlägg eller om du klickar på Gallery visas knappen Upload Images högst upp.

User Interface for Post Format Quote

User Interface for Post Format Link

Vi anser att post format vanligtvis ignoreras av användare på nybörjarnivå, främst för att det är utom synhåll. En box med alternativknapp uppmuntrar dem inte riktigt att använda post format. Att lägga till ett trevligt användargränssnitt kommer att uppmuntra användare att be om bättre support för post format i sina teman. Utvecklare kommer också att känna sig mer benägna och motiverade att bygga teman som har support för en mängd olika format. Det är därför som teamet bakom WordPress core har planer på att inkludera detta i WordPress 3.6. Tycker du att det är en bra idé att lägga till användargränssnittet för post format? Låt oss veta i kommentarerna under.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

10 kommentarerLämna ett svar

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jonas Lundman says

    We been using post formats since it arrived. A post with only a single link and some text doesnt need a excerpt when view the category. But other posts in the same category needs the excerpt at not to show the whole content. We Dont need to create a new post-type for layout reason.

    At the same point, a neebe would think a post-template (like page-tamplate) would be a obvious context for this function UI.

    – And we agree.

  3. Elliott richmond says

    I’m hoping that the next upgrade will have better support for post formats without having to use a plugin but, this plugin does look very useful for a better UX!

  4. Dwaynne Villiers says

    As cool as this is, can we see real worl applications? Or at least some sample scripts to point us into how this seemingly powerful feature can be deployed? For example, if I have a post, and all it is is a link or a video, how can I style it accordingly? How can I have an archive/category page with different styles applied to each post format? Example, if post format=video then use style x else if post format = link then use style y.

    Looking forward to more hidden gems form the WP Beginner team. Thanks!

  5. Louis says

    I have been working with WordPress for a couple years and didn’t even realize what those formats were about. I’ve been too busy playing with plugins that made sense to me.

    Having said that, now that you have cleared some of the haze about these fomats, I can stop looking for other plugins that do what this one does.. lol

    I think it would be a good idea to make those formats more obvious for people. That might help others avoid having to figure out how to make custom post types when these types of formats are already there.

    WordPress can be quite difficult to fully understand sometimes. There isn’t really a manual of any substance offered by WP Dev.’s (aside from the website pages that sometimes can’t even be found for lack of knowing exactly what to search for), so helpful tips like those you offer on this site are quite valuable, thanks for this and the many other enlightening topics and explanations you have included here.

  6. Bernie says

    Thanks for the article on post formats. I have heard the term but not really been sure what its all about. I am using one of the default WP themes 2011 and I can see the format radio buttons as you describe. However I can t for the life of me see what difference this makes.

    I did investigate the plugin mentioned but it hasn’t been updated in over 400 days and not rated compatible with WP 3.5. I would like to see the effect this formatting has on a post.

    • Louis says

      Hi Bernie,

      If you followed the link provided, the github project was updated 2 months ago for compatibility with WP 3.5.

  7. Donna says

    I think it’s a great idea. I’m pretty wp-savvy, and I even forget they exist most of the time. That would be a welcome change.

    Know what I would welcome even more? Page and post-specific widgets. There are plugins to handle this, but I haven’t found any that aren’t kinda kludgy or that don’t get to be way to difficult with a site with lots of pages.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.