A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [post-formats]

Post Formats allow for various types of posts to be styled or formatted based on their meaning.

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

display post format text in loop

If post format is Gallery or another then echo my custom text. Get post format from post id. I want to do like this code in wordpress post loop if (isset(get_post_format(gallery))){ echo 'Gallery'; } ...
4
votes
1answer
59 views

Renaming post formats after Gutenberg

I have renamed my post formats before, but since the Gutenberg update it doesn't work anymore. I tried Aaron's translation-solution from the link below, but WordPress doesn't use the translations in ...
0
votes
1answer
56 views

Post Format Link using Guttenberg

I was following a tutorial on youtube and made a post-format page called content-link which uses the post format type of link. The template just contains the following code: <a href="<?php ...
2
votes
1answer
38 views

How does WP detect format type (and can I make use of this)?

When I make a post with a theme that supports (all) post formats, WordPress will suggest the format type it thinks best fits my post. How does it do this? Is it possible to leverage this in, say, my ...
0
votes
0answers
14 views

How can I change the post format when a particular category is selected?

It used to be really easy to do this. Just stick a little jQuery in admin_footer. But that doesn't work any more, thanks to Gutenberg. Here's the functionality I need to reproduce: add_action( '...
0
votes
0answers
17 views

Post formats for Pages not saving

I have enabled Post Formats for Pages on my WordPress site but when I update the Page the format reverts back to Standard. Here is what I added to my functions.php file to enable Post Formats: ...
0
votes
0answers
10 views

Grid Col format in wordpress classic editor

I'm using the classical WordPress editor and having some trouble formatting it. I want to achieve the following result. Col 1 should be left blank. Col 2 and Col 3 will have content. I've tried ...
0
votes
2answers
50 views

How to display quote format by preg_match function?

I have defined quote post format for the theme: // Add post-formats for theme add_theme_support( 'post-formats', array( 'quote', ) ); After it, I want to display quote from the content. For ...
1
vote
2answers
120 views

Exclude certain post formats from pagination

I have the standard blog post format and gallery format. I have excluded all the gallery posts from the index.php page so only standard posts show up there. However, the gallery format posts are still ...
0
votes
1answer
119 views

Get first URL from post content

Basically all I want to do is if the post format is "link" rather than link to the post from the blog index, link to the link pasted within the post content. In my index.php I have: <h3> <...
0
votes
0answers
20 views

Change default wp-query using pre_get_posts

I would like to show all the posts of a post format on top of the default wp query and show all the other post formats below them (in the same query) using pre_get_posts. Please note that I need to ...
0
votes
0answers
11 views

Quote format category page

I would like to have a category page just show quotes without links or images. like this https://demo.zigzagpress.com/xplorer/category/post-format-quote/ it displays just the quote I see they have a ...
0
votes
1answer
32 views

I would like to have a quote page just to show quotes

I want to have quotes just show quotes and not the featured image like this https://demo.zigzagpress.com/xplorer/category/post-format-quote/ how would I go about stripping away the other things and ...
0
votes
1answer
93 views

Display archives based in post_format

I'm working in a project that needs to use post_formats. First of all, is there any way of create a new post format? The only thing I've found was to overwrite an existing one. In addition, they're ...
1
vote
0answers
42 views

trigger html cleanup for all posts

So i know that wordpress will auto clean / format html within posts / pages automatically when switching back and forth from text to visual: https://stackoverflow.com/questions/9907757/wordpress-...
0
votes
2answers
54 views

Is it possible to customize the post according to post format in single.php?

First let me know you that I have made a blog before and I have customize it according to the post format but I have customize it on the blog main page i.e. index.php. Now I am making a another blog ...
0
votes
2answers
57 views

show a post from a specific post format

I want to show 4 posts from a WordPress post type where 1 will show the post from the link format and the other 3 will be shown from another format. So in this case, how to use the query or what ...
1
vote
1answer
25 views

Query different number of posts with different formats in one go

I want to output 7 latest status posts and 5 latest aside posts in one go (they should be sorted in one list from latest to earliest). But I don't understand how to write such a WP_Tax_Query. I've ...
1
vote
0answers
85 views

How to add Post Format Taxonomy Archive page in the menu?

I have customized the archive template for the post format using the Wordpress template file structure. I have the file: taxonomy-post_format.php which works fine. The page is then accessible ...
1
vote
1answer
63 views

Remove certain post-formats from showing in blog?

I'm coding this wordpress theme and I enabled post-formats, currently designing them. What I want to do is use quote post-format to display reviews and I don't want it to show in blog posts. Is that ...
0
votes
1answer
51 views

Permalinks Question: Adding a prefix ONLY in front of all posts with the 'video' post format

This article is where I grabbed the initial code from, but I am wanting to target all posts that have the video post_format. I am able to change my $post_link to what I want it to be, but when I alter ...
1
vote
0answers
14 views

How to use format post in a pertinent way

I need to create a video post for my theme. I want to use post format via: add_theme_support( 'post-formats', array( 'video' ) ); So it is good, in my single.php I will able to get: if ( ...
0
votes
1answer
19 views

Can I assign a Folder for Post Formats, without it affecting WordPress' fallback/hierarchical system?

I have created a few Post Format Templates Files. format-aside and format-audio etc. At present, I am using <?php get_template_part (‘format’,get_post_format()) ;?> to call such Templates. In ...
0
votes
1answer
31 views

Will renaming a `content.php` file cause any problems?

I am currently creating a few templates for the various Blog formats, such as; 'Aside', 'Quote' and 'Gallery'. I see a lot of people create such Templates by naming such files as: content-aside....
0
votes
1answer
209 views

Return only one post format in index.php [duplicate]

I'm trying to customize index.php of my theme in order to return/display only one post format (images in this case), and hide all the rest(aside, video, link...). I tried to implement this code in my ...
0
votes
1answer
44 views

How to display list of video post on video section?

I already success to display combination post between articles & video using the code below: <?php if( have_posts() ) : ?> <?php while( have_posts() ): the_post(); ?> ...
0
votes
1answer
1k views

get_template_part() Not Working in Loop

I am having trouble getting get_template_part() to work on my index.php page. The template part is in the loop and is referencing a 'standard' post format. template code: <section id="content" ...
0
votes
2answers
250 views

Paste from word not preserving formatting

When I paste from word, it adding a lot of extra spacing around each block of text. If I look in html editor, it's putting a <strong> </strong> in between each block of text, which makes ...
1
vote
0answers
119 views

Hide Gallery from the_conent

I'm using a function to separate Featured Content. What I mean is that: if I selected format Gallery will show the First Gallery in my post , if I choose format Video , will show a video instead . ...
0
votes
2answers
35 views

My custom theme text and content format

Hi I am new to Wordpress development and I have learned a lot already but I do not understand why the text and content in the pages and posts does not keep the format that the user sets in the back-...
0
votes
1answer
530 views

How to add meta box for current post format?

I wanted to add meta box with current post format like when i select video post format then there will be appear video url input post just under the post editor. How to do that? any help
1
vote
1answer
104 views

Next Posts Prev Posts for Standard post format only

I am using the following functions in my single.php file to display links to Previous and Next posts: get_next_post(); get_previous_post(); I store them in 2 variables: $next_post = get_next_post();...
0
votes
0answers
317 views

How to get all posts in gallery post format template

I'm doing a WordPress theme, and I get stuck on one thing. As you know, the post-format in WordPress has different types of formats, I did all the types except the gallery. I get the category page ...
1
vote
1answer
27 views

Set Post Format if find a string in title or post content

I'm working with ITFFF in order to create posts, but I have a problem with the "Post Format". I need to change the Post Format to image if there are some specifics strings in the title or post content....
1
vote
0answers
40 views

What's the best practice way of handling custom fields in different post formats?

I am developing a theme that is compatible multiple post formats (video, audio, gallery, status, quote, etc.) From the perspective of a theme developer, what is the best practice way of handling ...
7
votes
2answers
7k views

Are content.php and content-single.php the same?

I understand that when using get_template_part('content', get_post_format()); it will help choosing a post format for specific page according to post format. And if there is no post format 'i.e it's ...
6
votes
0answers
353 views

static variable loop not working in Wordpress

I have a function in my wordpress theme that deletes the first embedded video in a video post. See code below. This is in the functions.php file. /* - function that hides first video in post content -...
2
votes
2answers
535 views

Removing the post format (type) slug

Got stuck trying to remove the post format slug, so i could have i.e. example.com/video for the video section instead of example.com/type/video. Usually it's done like this: add_action( 'init', '...
0
votes
2answers
667 views

Override post-formats in child theme

I'm using a child theme that only has video post format, but parent theme defines all post formats: add_theme_support( 'post-formats', array( 'gallery', 'link', 'image', 'quote', 'video', 'audio', '...
1
vote
1answer
88 views

Different markup for each post format

I use the underscores.me framework and in my content.php (the template displaying the loop of posts) I have the following code: <div class="article-text dot-ellipsis"> <div class="...
1
vote
1answer
878 views

How to get post attachments in gallery post format template

I'm doing a WordPress theme, and I get stuck on one thing. As you know, the post-format in WordPress has different types of formats, I did all the types except the gallery slideshow. What I need, for ...
0
votes
2answers
307 views

Get post format and use it as a CSS class in different spans

I use a <span> inside the loop and I would like to get each post format the post is containing as a class in separate spans. Example: If the post format is video and private: I would like to ...
0
votes
2answers
311 views

Display post formats differently on index.php (loop in function)

I'm new to WordPress and I'm hoping to display post formats differently on the home page; sort of like this image: The problem is that the theme I'm using is very different than other themes I've ...
1
vote
1answer
48 views

Is there any problem if I use get_template_part like this?

I want to display different content on my home page and in single pages, so I am using the following code in index.php: get_template_part( 'template-parts/content-home', get_post_format() ); At ...
1
vote
1answer
188 views

How to load a different header based on post format?

I have a difficult question. What's the best way to load a different header based on a post format? I guess I could load another loop around the header but I noticed the site does slow down. This is ...
0
votes
1answer
80 views

Setting 'post_format'

Currently I have the following code for my automated posting process file. // Create post object $my_post = array( 'post_title' => wp_strip_all_tags( trim( $row['title'] ) ), ...
0
votes
2answers
44 views

Post format or Type for List Type Posts

I want to create a post type / format where I can create list type posts... For example... h1.Title: The List Post Title like "Best Salads..." - Intro paragraph h2. Best Veg Salads - Intro -- h3. ...
1
vote
0answers
530 views

How can I remove the first video from a post and feature it?

I am trying to develop a theme in which when you select a 'video' post format, it automatically gets the first video from the post and features it (instead of where the featured image would normally ...
0
votes
1answer
1k views

Audio post format with Advanced Custom Fields

I am using the Advanced Custom Fields plugin to create custom fields for post formats. I have a field that only displays when the audio post format is selected. This is a text filed where the user ...
0
votes
2answers
644 views

Icon over thumbnail according to post format

How would I go about adding icons over post thumbnails according to their post format. So for example if I have a post with a post format of audio the thumbnail would show everywhere(widgets, category ...