Community Forums › Forums › Archived Forums › General Discussion › Metro Theme: HTML and Short Codes in Archive Intro Text?
Tagged: Archive Intro Text, category description, Metro, Metro theme.
- This topic has 16 replies, 7 voices, and was last updated 10 years, 7 months ago by gerardoritchey.
-
AuthorPosts
-
February 24, 2013 at 4:56 pm #22589excellentMember
How can I use HTML and Short Codes in the Archive Intro Text? I'm using the Metro Theme.
February 24, 2013 at 5:07 pm #22594dabyromMemberI'm using Metro. What do you mean by Archive Intro Text?
February 24, 2013 at 5:16 pm #22596excellentMemberFor the archive pages (category pages), I want to display the category description. While the Metro theme does not display the WP built-in category description field, it does display a filed called "Archive Intro Text". I want to use HTML in this field, and possible short codes.
March 1, 2013 at 2:13 pm #23575dabyromMemberI'm sorry but I'm not sure how to help on this one.
March 1, 2013 at 8:21 pm #23654Hard Boiled GregMemberHi excellent,
Html entered in this field is displaying for me OK, is it not for you? Have you tried disabling your plugins to rule out any possible conflicts?
Let me know and we'll keep troubleshooting.
Thanks,
Hard Boiled Greg
Website: Hard Boiled Greg Twitter: @hbgreg
April 30, 2013 at 5:23 pm #38650berticusMember@HArd Boiled Greg - HTML is just fine, but shortcodes don't work at all. I'm familiar with the PHP code below, but not what to put in the section I have labeled "taxonomy-description". Any help on this would be grand.
add_filter( 'taxonomy-description', 'shortcode_unautop' );
add_filter( 'taxonomy-description', 'do_shortcode' );Thanks so much!
Albert
May 1, 2013 at 3:37 pm #38835berticusMemberAnyone? Anyone at all?
May 2, 2013 at 1:40 pm #38960berticusMemberI'm going to resurrect this once again. I hope there is someone out there that can answer my question.
May 3, 2013 at 6:43 pm #39196berticusMemberDoes no one have an answer for this? Hard Boiled Greg? Anyone?
May 14, 2013 at 4:45 pm #40919berticusMemberI waited almost 10 days this time... Is there no one out there that can answer this question?
May 17, 2013 at 3:22 am #41329sokratesagogoMemberUntil there is a definitive answer, would the Genesis Widgetised Archive plugin suffice?
http://wordpress.org/extend/plugins/genesis-widgetized-archive/
“I toast, therefore I am”
May 17, 2013 at 10:40 am #41397berticusMember@sokratesagogo - I don't think so. Let me show you what I'm talking about.
The website is: http://themesquirrel.com/themeblog/opencart-themes/
That particular category page is one that I haven't been able to replicate with any plugins or find the code for in the theme files. As you can see at the top there is a link "Click here to read more" that doesn't work. The hidden body of text is almost 900 words and I would like for it to hide mostly until clicked. The text has been input into the "Archive Intro Text" box in the category's editing page.
The snippet of code I'm using is:
<script type="text/javascript">
function showMore() {
var mydiv = document.getElementById('myText');
mydiv.style.height = mydiv.scrollHeight;
}
</script><div id="myText" style="overflow:hidden; height:150px;">
<p style="text-align: center;"><strong>OpenCart Themes - An Overview</strong></p>Text text text.
</div>
<center><a href="javascript:;" onclick="showMore()">Click To Read More</a></center>I know how to add shortcode filters to say, widgets. For example, on this website:
http://webdesign.onyou.ch/2010/08/11/using-shortcodes-everywhere/
the author specifies the following code:
add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode');
to be added to 'functions.php'. In my case this would be for the 'functions.php' file under the child theme in Genesis.
I have been unable to identify what to replace 'widget_text' with in order to add the shortcode filter to the appropriate box in the archive. I have also been unable to identify what to replace 'do_shortcode' in order to execute the above javascript.
I hope that was clear... If there are any additional questions concerning this situation please ask and I will answer to the best of my ability.
Thanks!
Albert
May 17, 2013 at 11:52 am #41404essaysnarkParticipantHi Albert - I've never used the News theme that you're running, but let me take a swipe at this.
Did you try using those two widget_text filters that you specified? They look fine to me exactly as they are. Try including them in your theme's functions.php with no changes. The first one is to prevent autoformatting of ` ` when the shortcodes are rendered, and the second will allow them to be rendered in a text widget. I *think* that the bit that allows them in a text widget might actually affect the portion you've got at the top of your Category Archive page, too.
However I'm a little confused why you're looking how to add shortcodes... Are you trying to find an alternative instead of the JavaScript to do an accordian display of the extra text under the "Read More" thing?
You've got JavaScript errors on that page about stuff unrelated to this, and even if those are cleared, I think you've got errors in the JavaScript you included above. At a minimum there's a ; missing from the onClick. Maybe try this instead? (warning: no JavaScript expert here!):
May 17, 2013 at 3:37 pm #41436berticusMemberShortcodes don't work with the code you specified added to 'functions.php'.
All I'm trying to do is execute a standard 'accordion display' as you called it. So far I've had no luck. I think I've got too much going on here. Perhaps I just need solid javascript before I go fussing about with the 'functions.php'.
Initially I was looking for a shortcode plugin that would allow me to implement the accordion display. Then I switched focus to javascript.
The code you provided didn't work for expanding the accordion. Sorry.
If anyone has a solution for this I would greatly appreciate input.
Albert
May 17, 2013 at 4:06 pm #41440essaysnarkParticipantAlbert - I just realized when coming back to this post that the JavaScript snippet that I entered got changed when I saved my message. This is what it should have been:
`
<a href="#" rel="nofollow">Click To Read More</a> `
GRRRRRRR.
<a href="#" onclick="showMore();">Click To Read More</a>
PHEW!!
I still don't know if that will solve your problem.The change to functions.php definitely does allow shortcodes to be rendered in a text widget. If you have a way to display this information through a widget in your layout then that might be an option using one of those accordian plugins. You might want to contact StudioPress support to ask them about shortcodes in that specific field in the theme.
May 20, 2013 at 1:23 pm #41871berticusMember@essaysnark - Didn't work with the revised bit of code, either.
Thanks for the input, everyone. I'm going to keep looking around for answers. If anyone has any ideas I would love to hear them, though.
Albert
August 21, 2013 at 6:06 am #57880gerardoritcheyMemberThe genesis framework uses it's Category Archive Settings section for the category to display this information. I'm assuming they made the switch so that you could put a headline in there.
The genesis framework completely ignores the description.
Unfortunately, there's nifty filters that let the Category Description handle shortcodes, but I can't seem to find anything for the Category Archive Settings.
If you want to have shortcodes there you're going to have to unhook the genesis implementation of this, and go back to using category_description()
Look inside the twentythirteen category.php theme to see how they do it.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.