Skip to main content
added 235 characters in body
Source Link
Arete
  • 318
  • 1
  • 3
  • 18

I want to use post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the video post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );

I am using _s for theme development so inside the theme root folder I have a folder called template-parts with content-none.php content-page.php content-search.php content-single.php content.php and single-video.php

I want to use post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the video post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );

I want to use post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the video post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );

I am using _s for theme development so inside the theme root folder I have a folder called template-parts with content-none.php content-page.php content-search.php content-single.php content.php and single-video.php

deleted 8 characters in body; edited title
Source Link
Arete
  • 318
  • 1
  • 3
  • 18

Custom Style post formats differently only in single

I want to use custom post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the customvideo post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );

Custom post formats only in single

I want to use custom post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the custom post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );

Style post formats differently only in single

I want to use post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the video post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );
Added code
Source Link
Arete
  • 318
  • 1
  • 3
  • 18

I want to use custom post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the custom post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );

I want to use custom post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the custom post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

I want to use custom post types to style video posts differently. This should be quite easily achieved with custom post types.

But I only want the custom post type to affect the post when it is in "single".

In other words I want the front page to stay as it is but when a video post is clicked on (and single.php is rendered) I want it to be styled differently than regular posts.

How can I achieve this?

I have read a dozen articles about custom post types, but all of them explain how to render CPT on the front page, which is not what I need.

Functions.php

add_theme_support( 'post-formats', array(
    'aside',
    'gallery',
    'image',
    'link',
    'video',
    'quote',
    'link',
    'video',
    'status', 
    'audio', 
    'chat'
) );
Source Link
Arete
  • 318
  • 1
  • 3
  • 18
Loading