Metro Theme: HTML and Short Codes in Archive Intro Text?

Community Forums Forums General Discussion Metro Theme: HTML and Short Codes in Archive Intro Text?

This topic is: not resolved

This topic contains 16 replies, has 7 voices, and was last updated by  gerardoritchey 11 months, 2 weeks ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #22589

    excellent
    Participant
    Post count: 1

    How can I use HTML and Short Codes in the Archive Intro Text?  I’m using the Metro Theme.

    #22594

    dabyrom
    Participant
    Post count: 17

    I’m using Metro.  What do you mean by Archive Intro Text?

    #22596

    excellent
    Participant
    Post count: 1

    For 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.

    #23575

    dabyrom
    Participant
    Post count: 17

    I’m sorry but I’m not sure how to help on this one.

    #23654

    Hard Boiled Greg
    Participant
    Post count: 88

    Hi 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

    #38650

    berticus
    Participant
    Post count: 8

    @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

    #38835

    berticus
    Participant
    Post count: 8

    Anyone? Anyone at all?

    #38960

    berticus
    Participant
    Post count: 8

    I’m going to resurrect this once again. I hope there is someone out there that can answer my question.

    #39196

    berticus
    Participant
    Post count: 8

    Does no one have an answer for this? Hard Boiled Greg? Anyone?

    #40919

    berticus
    Participant
    Post count: 8

    I waited almost 10 days this time… Is there no one out there that can answer this question?

    #41329

    sokratesagogo
    Participant
    Post count: 34

    Until 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”

    #41397

    berticus
    Participant
    Post count: 8

    @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

    #41404

    essaysnark
    Participant
    Post count: 336

    Hi 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!):

    `
    Click to Read More
    `

    #41436

    berticus
    Participant
    Post count: 8

    @essaysnark

    Shortcodes 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

    #41440

    essaysnark
    Participant
    Post count: 336

    Albert – 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:

    `[html]
    <a href="#" rel="nofollow">Click To Read More</a>
    `[/html]

    GRRRRRRR.

    [php]
    <a href="#" onclick="showMore();">Click To Read More</a>
    [/php]

    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.

    • This reply was modified 1 year, 2 months ago by  essaysnark.
    • This reply was modified 1 year, 2 months ago by  essaysnark.
    • This reply was modified 1 year, 2 months ago by  essaysnark.
    • This reply was modified 1 year, 2 months ago by  essaysnark. Reason: because the code wouldn't stick
    • This reply was modified 1 year, 2 months ago by  essaysnark.
    • This reply was modified 1 year, 2 months ago by  essaysnark.
    • This reply was modified 1 year, 2 months ago by  essaysnark.
    • This reply was modified 1 year, 2 months ago by  essaysnark. Reason: because the code wouldn't stick
Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.