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
0 answers
10 views

How to reproduce the post format field in a front end form?

I am looking for a php snippet to display the field "post format" of the wordpress admin in a front end form. It is a conditional field, and some of them need to have a special output (ex: ...
Aurore's user avatar
  • 1
0 votes
4 answers
24 views

How to customize Date Format for American visitors?

Basically, I just want the format to be mdY if an American / US Resident is using the site, and dmY for everyone else. Right now, the only way I see I can do this is changing it via radio buttons. Is ...
QRIOS WORLD's user avatar
0 votes
0 answers
13 views

Show a featured image with "Link" Post Type?

When I use a Post Format type of "link", no featured image shows up, just the URL on a blue background where I would expect the Featured Image to appear. A Post Format of "Video" ...
wittwho's user avatar
1 vote
1 answer
123 views

How to filter posts by post format "standard" from wp-json api?

I need to get posts through wp-json having "standard" as their format. I've been trying different methods like using WP_Query like this. function get_blog_posts() { $posts = new WP_Query(...
Nipuna's user avatar
  • 21
0 votes
0 answers
19 views

wordpress post formats

i did my best to solve this problem of post formats not showing but i couln't i have checked my screen options and i have added theme support to my functions.php : <?php $ver = wp_get_theme()->...
mod7ex's user avatar
  • 123
0 votes
1 answer
96 views

how to retrieve the image title for image Post Format

Hope everyone is having a good day. in WordPress Codex Post Format the image post format is defined as image – A single image. The first tag in the post could be considered the image. Alternatively, ...
Muhammad Kashif's user avatar
0 votes
1 answer
33 views

How to display all posts not in a post_format

Using WP_Query() I want to display all posts -except- those with the 'image' post_format. I tried this, but it did not work. $args = array( 'relation' => 'NOT', 'tax_query' =&...
jchwebdev's user avatar
  • 763
0 votes
1 answer
1k views

How to preserve exact formatting when copy pasting from Facebook into WordPress (or elsewhere)?

How can I copy and paste comment threads (and sometimes the original post) from Facebook into WordPress (or elsewhere) and preserve exact formatting? Screenshot? ok, but text etc is better. Both + ...
Jonathon Neville's user avatar
1 vote
1 answer
215 views

There is any way to remove post-format filter? [closed]

I have tried to remove_theme_support( 'post-formats') set higher priority but it is not working
Anupam Tiwari's user avatar
0 votes
1 answer
204 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'; } ...
Mohammad Mehedi Hassan's user avatar
4 votes
1 answer
549 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 ...
Benjamin Antoni Andersen's user avatar
0 votes
1 answer
522 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 ...
Patrick Raiford's user avatar
2 votes
1 answer
76 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 ...
Matthew Brown aka Lord Matt's user avatar
1 vote
0 answers
86 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: ...
Chad Snow's user avatar
  • 103
0 votes
2 answers
235 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 ...
EGWorldNP's user avatar
1 vote
2 answers
820 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 ...
user10980228's user avatar
1 vote
1 answer
597 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> <...
caffeinehigh's user avatar
0 votes
1 answer
36 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 ...
jivan's user avatar
  • 1
0 votes
1 answer
220 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 ...
Agustín Moglie's user avatar
1 vote
0 answers
58 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-...
Ninja Panda's user avatar
0 votes
2 answers
352 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 ...
Owaiz Yusufi's user avatar
1 vote
2 answers
278 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 ...
AB Siddik's user avatar
  • 113
1 vote
1 answer
27 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 ...
batollo's user avatar
  • 13
1 vote
0 answers
298 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 ...
Jeda Dragon's user avatar
1 vote
1 answer
190 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 ...
Bill Hicks's user avatar
0 votes
1 answer
87 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 ...
Tasa's user avatar
  • 1
1 vote
0 answers
15 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 ( ...
user3415011's user avatar
0 votes
1 answer
21 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 ...
Craig's user avatar
  • 358
0 votes
1 answer
36 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....
Craig's user avatar
  • 358
0 votes
1 answer
341 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 ...
zak ben's user avatar
0 votes
1 answer
63 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(); ?> ...
The Lee's user avatar
  • 21
0 votes
1 answer
3k 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" ...
Frederick M. Rogers's user avatar
0 votes
1 answer
408 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 ...
omega's user avatar
  • 109
1 vote
0 answers
121 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 . ...
Locke's user avatar
  • 185
0 votes
2 answers
44 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-...
palmaone's user avatar
0 votes
1 answer
734 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
Nayeem Hyder Riddhi's user avatar
1 vote
1 answer
225 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();...
gil hamer's user avatar
  • 641
0 votes
0 answers
365 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 ...
user avatar
1 vote
1 answer
31 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....
Jean AL's user avatar
  • 23
1 vote
0 answers
48 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 ...
danny471's user avatar
8 votes
2 answers
11k 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 ...
Eibo's user avatar
  • 247
8 votes
1 answer
593 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 -...
danny471's user avatar
2 votes
2 answers
772 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', '...
lucian's user avatar
  • 312
0 votes
2 answers
866 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', '...
IAmJulianAcosta's user avatar
1 vote
1 answer
99 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="...
Arete's user avatar
  • 288
1 vote
1 answer
1k 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 ...
ahmad araj's user avatar
0 votes
2 answers
450 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 ...
Arete's user avatar
  • 288
0 votes
2 answers
391 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 ...
OmiYaHomi's user avatar
1 vote
1 answer
60 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 ...
Ayd In's user avatar
  • 11
1 vote
1 answer
343 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 ...
Gregory Schultz's user avatar

1
2 3 4 5