Questions tagged [post-formats]

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

0
votes
0answers
8 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
29 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
49 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
28 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
15 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
32 views

Is it possible to add gallery image instead of the post feature image in the Gutenberg editor when I'll setting this post format is gallery?

I want to add gallery images (WP new editor Gutenberg) in the post instead of the post feature image and It will be set when I'll set this post format is the gallery. Thank you.
0
votes
0answers
10 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
0answers
8 views

Including Post Format in filters for “All Posts” [duplicate]

How can I add a filter for post format on top of the "All Posts" page in the backend?
0
votes
1answer
62 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
35 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
22 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
34 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
24 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
61 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
47 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
38 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
15 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
29 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
189 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
41 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
188 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
118 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
34 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
432 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
79 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
305 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
25 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 ...
6
votes
2answers
5k 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 ...
5
votes
0answers
306 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
467 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
577 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
843 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
272 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
278 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
44 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
181 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
70 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
43 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
505 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
870 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
595 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 ...
2
votes
1answer
675 views

How to generate a featured image from a video embeded in a metabox

I have a metabox that allows me to add videos from Youtube and Vimeo on posts with video post format. I am now looking into automatically generate thumbnails for these post with video post format. ...
0
votes
1answer
328 views

Update caption for metabox gallery images

Just wondering how to make the caption on my metabox gallery images updatable. I have the caption on a textarea so it can be easily updated. I can change the contents of this textarea, cant seem to be ...
0
votes
1answer
461 views

How to show post format gallery metabox image caption in the post front end

After getting my images through a metabox for a gallery post format I have the following code to show them on the post front end: <?php if ( !empty( $images ) ) { foreach ( $images as ...
0
votes
1answer
1k views

Get image captions for images on gallery post format metabox

I have a post format gallery. I have created a metabox to add my images: function mytheme_show_post_gallery_metabox( $post ) { wp_nonce_field( 'mytheme_post_gallery_metabox', '...