Tag Info

Hot answers tagged

2

Wordpress already has these classes in place for you, so you can basically target a specific page in CSS without adding additional classes. Take a look at the default body_class section in the codex, and more particulary at the pages section


2

If it really is just for one page you could use a conditional on the_ID(); from within your shortcode class (it is a custom shortcode right?) $class = the_ID() == 213 ? "some-other-class" : ""; $myhtml = sprintf("<div class='some-class %1$s'>%2$s</div>", $class, $content); The other option is to add parameters or "attributes" to your ...


2

You need to call global $post before using $post->ID, or better, use get_the_ID() instead.


2

You have used the same quotation characters in 2 different contexts. You should write the shortcode in the following way: [example text='<a href="http://example.com">lorem</a> ipsum']Lets roll[/example] Then, "unescape" HTML entities on the shortcode output: $return_string = '<div class="some-class">'. html_entity_decode($text) . ...


1

This is probably the result of the wordpress 4.0.1 security fix which changed how shortcodes are handled http://wptavern.com/wordpress-4-0-1-exposes-bad-development-practices-used-in-some-plugins. While I am not sure about the details your shortcode handling seems to match the general description of trying to parse the shortcode by yourself instead of ...


1

Shortcode's callback should return a string, not echo it. function getMyShortCode_func() { return '<div class="abc">Hello world.</div>'; }


1

I wrote a php script for it, is not a wordpress plugin , but is good point to start :) $fb_id = "Mashable"; // here your id account $fb_uri = "http://feeds.feedburner.com/~fc/"; $app_uri = "http://feedcounttext.appspot.com/?uri="; $count_uri = $app_uri.$fb_uri.$fb_id; $fb_count = fopen($count_uri, "r"); echo fgets($fb_count); fclose($fb_count); source ...


1

Update for everyone visiting this thread (2015) jwplayer_tag_callback() does not work anymore, you'll get a fatal error telling you the function is not defined. Instead insert a player programmatically like this: echo JWP6_Shortcode::the_content_filter( '[jwplayer file="'. $videoUrl .'"]' ); (Found here.)


1

Your output is expected, but before I come to the solution and why's, you have a couple of issues here You are either using query_posts or nullifying the main query global which you should never do. The give away is your loop (if (have_posts()) : while (have_posts()) : the_post();) and the use of wp_reset_query();. You should be using a proper instance of ...


1

You need to get $current_cityinfo first. As in: $current_cityinfo = get_option('current_cityinfo'); Or add this code: global $current_cityinfo; above your return line.


1

As I already stated in comments, extract() should never be used. It was removed from core and the codex for very specific reasons and the use there of is strictly not recommended in future applications and functions. Please see trac ticket #22400 for complete details. As stated before, the codex was also updated accordingly, so you can look at the examples ...


1

You could just echo do_shortcode( $content ); Function Reference/do shortcode


1

It seems that you might have a lot of these .csv files. I would suggest to use only one attribute and then passing the appropriate name to that attribute or the prefix of the file name and then building the file name from there. You can try one of the following (I have not done any verification, you will propbably check that the attribute is not empty and ...



Only top voted, non community-wiki answers of a minimum length are eligible