Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$15
Allow posts to show HTML
http://www.willpowerproductions.co.uk/
However it does not allow me to show html here only standard text, how can I make it show exactly whats in the post and output html?
For example I put youtube embed codes in the post but it doesn't show the youtube vid in the sidebar.
Here is the code for the widget:
<?php
/*
Plugin Name: Jquery Accordion
Plugin URI: http://www.jeffikus.com/downloads/wordpress-jquery-accordion-plugin/
Description: A jquery accordion of the latest posts in a specific category
Version: 0.1
Author: Jeffikus
Author URI: http://jeffikus.com
*/
/* Copyright 2009 Jeffikus (email : pearce DOT jp [at] gmail DOT com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
if (!class_exists("JqueryAccordion")) {
class JqueryAccordion {
/*
* Constructor
*/
function JqueryAccordion() {
}
/*
* Function to load the required jquery libraries
* jquery
* UI
* accordion
*/
function load_jquery() {
//Load required jquery libraries and stylesheets and perform accordion functionality
$siteURL = get_bloginfo( 'url' );
echo '<link type="text/css" href="'.$siteURL.'/wp-content/plugins/jquery-accordion/jquery/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="'.$siteURL.'/wp-content/plugins/jquery-accordion/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="'.$siteURL.'/wp-content/plugins/jquery-accordion/jquery/ui/ui.core.js"></script>
<script type="text/javascript" src="'.$siteURL.'/wp-content/plugins/jquery-accordion/jquery/ui/ui.accordion.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#accordion").accordion({active: false, alwaysOpen: false, autoheight: false});
});
</script>
';
}
/*
* Function to load the accordion when called using the shortcode:
* [jqueryaccordion posts="3" category="Featured"]
*/
function jqueryaccordion_func($atts) {
//set defaults
extract(shortcode_atts(array(
'posts' => '3',
'category' => 'Featured',
), $atts));
//set query arguments
$argsAccordion=array(
'posts_per_page'=>$atts['posts'],
'category_name'=>$atts['category']
);
//query the posts
$postResults = new WP_Query($argsAccordion);
//BEGIN - results layout
$result = '<div id="accordion">';
//loop through the posts
while($postResults->have_posts()) : $postResults->the_post();
$result .= '<h3><a href="#">';
$result .= get_the_title($postResults->ID);
$result .= '</a></h3>';
$result .= '<div><p>';
$result .= get_the_excerpt();
$result .= '</p></div>';
endwhile;
$result .= '</div>';
//END - results layout
//return results
return $result;
}
}
} //End Class JqueryAccordion
if (class_exists("JqueryAccordion")) {
$jqueryAccordion = new JqueryAccordion();
}
//Actions and Filters
if (isset($jqueryAccordion)) {
//Actions
//hookup the function to load jquery in the header
add_action('wp_head', array(&$jqueryAccordion, 'load_jquery'), 1);
//assign function to a shortcode
add_shortcode('jqueryaccordion', array(&$jqueryAccordion, 'jqueryaccordion_func'));
//Filters
}
?>
This question has been answered.
Ross Gosling | 09/06/11 at 4:23pm
Edit
(5) Possible Answers Submitted...
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
09/06/11
4:37pmJulio Potier says:Hello
You only have to fill a real excerpt in your posts because WordPress sanitize the content into the excerpt if you leave it blank on publication.
See youPrevious versions of this answer: 09/06/11 at 4:37pm
-

Last edited:
09/06/11
4:51pmNavjot Singh says:Try replacing
$result .= get_the_excerpt();
with
$result .= get_the_content();
in the plugin file. Wordpress strips all HTML from the excerpt so you will need to display full content for which this change is necessary.Previous versions of this answer: 09/06/11 at 4:51pm
-

Last edited:
09/06/11
4:34pmHardeep Singh says:Navjot is faster than me :)
Just to add to his answer, this will display the complete content of the post.
So create content accordingly.
Thanks!!! -

Last edited:
09/06/11
4:35pmJohn Cotton says:By default, WordPress strips HTML from content when it automatically creates an excerpt (ie if you leave that box blank).
So either change get_the_excerpt to get_the_content or, if you want a shorter version for your accordian, put an explicit excerpt in the box on the post edit page. -

Last edited:
09/06/11
10:04pmBenjamin Goldberg says:I don't know if this is will work for you but I posted a function which allows for some tags in excerpts as long as the tag is properly closed, which could be a problem with excerpts because a closing tag might get cut off from a starting tag. If you want to try it you should probably copy the get_the_excerpt function and the safetags function from my functions.txt file nto your functions.php file. More here
Previous versions of this answer: 09/06/11 at 10:00pm | 09/06/11 at 10:04pm
This question has expired.
Ross Gosling voted on this question.
Current status of this question: Completed
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
