Community Forums › Forums › Archived Forums › General Discussion › Modifying visible elements in "Video" Post Format on Mindstream theme
Tagged: genesis mindstream
- This topic has 5 replies, 2 voices, and was last updated 7 years, 6 months ago by
erh.
-
AuthorPosts
-
September 15, 2017 at 1:28 pm #211539
erh
MemberI am using Mindstream theme. Most of my posts are format "Standard", but I just made a post which has a post format of "Video". The title is not showing up in the blogroll or post page.
I was able to get around the post page by manually adding a title with an H1 tag. But I can't figure out how to get that title to show up in the Blogroll.
Example here, notice the first post is a link to a video but does not include a title:
http://www.practicalnetworking.net/How can I modify the post format "Video" to also display the title in the blogroll.
Thanks.
http://www.practicalnetworking.net/September 16, 2017 at 5:22 am #211552Victor Font
ModeratorHow did you add the video post format? Did you use the this snippet: https://my.studiopress.com/documentation/snippets/post-formats/add-post-formats/?
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?September 19, 2017 at 5:21 pm #211645erh
MemberIt was added from the beginning when I downloaded / applied the theme. I did not do anything special to "enable" the formats.
I did find this in my
themes/mindstream/functions.php
file:/** Add support for post formats */ add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); add_theme_support( 'genesis-post-format-images' );
Is that relevant?
September 22, 2017 at 3:07 am #211737Victor Font
ModeratorI downloaded Mindstream and looked through the code. Certain post elements are removed on purpose by the theme author for posts that have a post format. If you open functions.php, you'll find the following code at line 33:
add_action( 'genesis_before_post', 'mindstream_remove_elements' );
Comment this line out and it will return the title.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?September 26, 2017 at 5:28 pm #211880erh
MemberVictor! Thank you so much for doing this, I really appreciate your help!
I'm afraid that didn't quite work though. When I commented out that line, I got this error when loading the blog:
Parse error: syntax error, unexpected '}' in /home/practi59/public_html/wp-content/themes/mindstream/functions.php on line 56
I had to rollback.
Line 56 is the closing bracket of the
mindstream_remove_elements
function:function mindstream_remove_elements() { // Remove if post has format if ( get_post_format() ) { remove_action( 'genesis_post_title', 'genesis_do_post_title' ); remove_action( 'genesis_before_post_content', 'genesis_post_info' ); remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); } // Add back, as post has no format else { add_action( 'genesis_post_title', 'genesis_do_post_title' ); add_action( 'genesis_before_post_content', 'genesis_post_info' ); add_action( 'genesis_after_post_content', 'genesis_post_meta' ); } } <--- this is line 56 I'm beginning to think the removal of line 33 prevented the "add_action" calls in the "else" clause in the function before to not run, and that is what caused the error... hrmmm..
September 26, 2017 at 5:30 pm #211881erh
MemberVictor! I must thank you again, I think you lead me to the right answer.
I commented the IF clause, and the brackets of the ELSE clause, causing the "add_actions" to run every time, no matter what. That seemed to not break my blog, and it also enabled all the titles (et al) on the video post format post.
I cleaned it up and commented the poop out of it so I remember what changes I made.
You probably know more than I... are changes to the themes functions.php file permanent? Am I going to lose all these next time I updated wordpress?
Final function:
function mindstream_remove_elements() { /*** EDIT 9/26 - this section removes post title (et al) from non default post formats *** It was commented out to disable the removal of these attributes. BUT, the "else" *** clause is what enables them for all posts. A copy of the contents of the "else" clause *** has been added below. To revert, delete the three "add_actions" immediately after this *** comment block, and uncomment this block *** // Remove if post has format if ( get_post_format() ) { remove_action( 'genesis_post_title', 'genesis_do_post_title' ); remove_action( 'genesis_before_post_content', 'genesis_post_info' ); remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); } // Add back, as post has no format else { add_action( 'genesis_post_title', 'genesis_do_post_title' ); add_action( 'genesis_before_post_content', 'genesis_post_info' ); add_action( 'genesis_after_post_content', 'genesis_post_meta' ); } *** THE "add_action" lines below were duplicated from the "else" clause above */ add_action( 'genesis_post_title', 'genesis_do_post_title' ); add_action( 'genesis_before_post_content', 'genesis_post_info' ); add_action( 'genesis_after_post_content', 'genesis_post_meta' ); }
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.