global $wp_filter;
$filter=$wp_filter['comments_array'];
lub
$filter=$wp_filter['the_content'];
print_r($filter);
global $wp_filter;
$filter=$wp_filter['comments_array'];
lub
$filter=$wp_filter['the_content'];
print_r($filter);
plik:
wp-includes/comment-template.php
funkcja:
function comments_template
sql:
$wpdb->last_query;
$arr_cat=get_the_category($post->ID);
Przykładowe zastosowanie:
if(is_single()):
Kategorie
$cat=''; $arr_cat=get_the_category($post->;ID);
for($i=0,$c=count($arr_cat);$i<$c;$i++) { if($c>1 && $arr_cat[$i]->cat_ID==8) continue; $cat.=','.$arr_cat[$i]->cat_ID;
};
$cat=substr($cat, 1);
$recent = new WP_Query("cat=".$cat."&showposts=10");
while($recent->have_posts()) : $recent->the_post();
...
endwhile;
endif;
Losowe wybranie postów z wybranych kategorii, opcja rand
<?php $recent = new WP_Query("cat=1,2,3&showposts=10&orderby=rand"); while($recent->have_posts()) :
$recent->the_post();?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<?php endwhile; ?>
Pobranie informacji o blogu funkcja bloginfo
echo bloginfo('url');
echo bloginfo('name');
echo '<img decoding="async" src="'.bloginfo('template_url').'"/images/top.gif" alt="Top" />';
Dostępne wartości parametru funkcji:
name
description
admin_email
url
wpurl
stylesheet_directory
stylesheet_url
template_directory
template_url
atom_url
rss2_url
rss_url
pingback_url
rdf_url
comments_atom_url
comments_rss2_url
charset
html_type
language
text_direction
version