Tag Info

Hot answers tagged

3

Huh. It had never actually occurred to me to use widget instance as cache. I hadn't ever seen such implementation either. This is quite an original idea, and as such it is hard to accurately point out benefits and issues with implementation. For starters update() doesn't actually save anything, it just used as check for actual save and I won't say where ...


3

Shortcodes are not supported in the Text Widget by default. Add the following to your functions.php: // Enable shortcodes in WP Text Widget add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode', 11); Instead of wrapping the video URL in the [embed] shortcode, use the following in the Text Widget: [video ...


1

Try adding another attribute [video src="http://youtu.be/JQ_2De2cnzI&rel=0&showinfo=0" poster="/path/to/image-placeholder"] See the Codex


1

Use page templates and template parts. On your Front Page, you include the Texts as Template Parts: Front Page +---------------+---------------+---------------+ | Page A | Page B | Page C | +---------------+---------------+---------------+ | Link Page 1 | Link Page 2 | Link Page 3 | | Text 1 (TP1*) | Text 2 (TP2*) | Text 3 (TP3*) ...


1

You can hook into the 'get_search_form' action hook ( check out the "last option" part of the link below ). Set the priority high enough to override anything created in a theme. A plugin could look like ( from the link below ): function my_search_form( $form ) { $form = '<form role="search" method="get" id="searchform" class="searchform" action="' ...


1

Here is my suggested solution, it requires that you use Widget Logic or Dynamic Widgets. Add the code below to your theme or custom plugin Insall one of the plugins I mentioned Create the page(s) or post(s) that we'll use for the iframe src attribute on the non-WordPress site (give it a descriptive title, developers tend to forget a lot). Add the widget ...


1

You have slight timing issues because you generate title first (in constructor call), but postpone text domain load to later (init at default priority). Text domain mus be loaded for __() to translate correctly. Those are not “lazy”, they generate and return strings right where they are called. Text domain should be loaded very early, Codex recommends at ...


1

This is the problem: $link = the_permalink(); Replace it with: $link = get_permalink(); Notice that the WordPress the_* functions will echo the output, but get_* will return it. But of course there are exceptions to this rule ;-) So you don't need this: echo the_title(); Just use this instead: the_title(); or the usage example given by ...


1

Just to add to the answer from @birgire, you can also just use the_title( $before, $after, $echo ); in the following matter to get the same result the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );


1

you can create new widget area. function header_widget_areas() { register_sidebar( array( 'name' => __( 'header', 'header' ), 'id' => 'header', 'description' => __( 'Insert something for about us text.', 'header' ), 'before_widget' => '<div class="widget span3">', 'after_widget' => ...



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