Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Quanticbyte on "Order problems insert code in the_content()"

$
0
0

I'm trying to create my first plugin for WP, the problem that I have is that when you want to insert the code in the text that captures the_content () I insert it in the beginning and not the end,for defect may insert it at first, as I can change the order and coming out at the end?

function wp_skin_home($text)
{
$pagines = pagines_inserir(); //array name valid pages
$pagina_actual = get_query_var('pagename');

if(in_array($pagina_actual,$pagines))
 {
  //add CSS
  wp_register_style('demo1_css_user',WP_PLUGIN_URL.'/demo1/user.css');
  wp_enqueue_style('demo1_css_user');
  //add Js
  wp_register_script('demo1_js_user',WP_PLUGIN_URL.'/demo1/user.js');
  wp_enqueue_script('demo1_js_user');

  $text2 = mostra_demo1_pagina($pagina_actual);
  return $text.$text2; //<------------------------- PROMLEM ORDER
 }
else { return $text; }
}

add_action('the_content','wp_skin_home');

function mostra_demo1_pagina($pagina_actual) return html code

tnks!


Viewing all articles
Browse latest Browse all 8245

Trending Articles