Community Forums › Forums › Archived Forums › General Discussion › Archive Text Intro issue
Tagged: archive text intro, category template
- This topic has 6 replies, 2 voices, and was last updated 11 years, 7 months ago by
chrisman.
-
AuthorPosts
-
July 24, 2013 at 8:50 am #52229
chrisman
MemberI'm using the News theme with Genesis. I have one category in which I have used the Archive Intro Text option to show some unique information at the top of the first page of that category;
http://www.behindthemixer.com/content/category/church_audio_101At one point, in my Archive Intro Text, I need to use a shortcode to add a plugin-generated form. As it appears, there is no way to use shortcodes in Archive Intro Text. I looked into add_filter / do_shortcodes and it does appear to be possible if I had this information in the category description..but then it would appear on EVERY page, not just the first page of the category.
I looked in the News Child Theme for category.php so I could customize it for a specific category but it appears that News doesn't have one. So, then it comes to creating a custom one and the stuff I'm finding on Google is more about creating a completely different category.php page. I want a category page template just like what is normally produced (blog title, thumbnail, excerpt, etc) but where i can customize the header. I can't figure out what genesis file to use as a basis. The archive page looks like the generic single line archive which I don't want. I'm stumped.
One last note, I do have php code I can use for the plugin-created form (newsletter form) but archive intro text appears to strip out the php tag stuff. 🙁
http://www.behindthemixer.com/content/category/church_audio_101July 24, 2013 at 1:34 pm #52301Brad Dalton
ParticipantJuly 24, 2013 at 1:50 pm #52304chrisman
MemberBrad, I'm trying to use a shortcode in the Archive Intro Text field for a category. In a post I read from you, you mentioned (confirmed) that that particular field doesn't accept shortcodes. I have a wordpress plugin that creates my newsletter forms which I use via shortcode. Therefore, for me to get the newsletter form to appear before only one specific category, I can't use the Archive Intro Text.
This means I have to create a category template. I want everything to appear like the normal category listing except, for this category, the intro text plus a form should be displayed on the first page of the category.
As this point, i have created a category-[slug].php file.
<?php /* Template Name: category-church_audio_101 */ add_action('genesis_before_content', 'custom_church_audio_101'); function custom_church_audio_101() { if ($paged < 2 ) { echo "[unique category intro text / form here]" } } genesis(); ?>
But don't I need to have all of the loop code in there somewhere?
July 24, 2013 at 2:17 pm #52317Brad Dalton
ParticipantI think i did update that post with a solution which is why i'm interested in your question.
Let me test this locally and see if i can help you.
July 24, 2013 at 2:39 pm #52319Brad Dalton
ParticipantThis code will execute the contact form shortcode and display the form immediately above the intro text using the web-design category slug
https://gist.github.com/braddalton/6074297
July 24, 2013 at 2:53 pm #52320Brad Dalton
ParticipantJuly 25, 2013 at 11:07 am #52457chrisman
MemberGreat! I'm testing it out and it's really close to what I need. I'm sure i can get it from here. thanks!
-
AuthorPosts
- The topic ‘Archive Text Intro issue’ is closed to new replies.