1) Take a look at this example
add_filter( "xxx_xxxxx", "blah_blah" );
function blah_blah(){
echo "filter added";
}
xxx_xxxxx
can be anything like my_filter or it should be one of the name listed here.
2) Lets say i have some content in my theme outside the_content
loop.
Example
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="entry-content">
<?php the_content(); ?>
</div>
<div class="custom-content">
<p>Blah blah some text goes here</p>
</div>
<?php endwhile; ?>
Is there a way to filter Blah blah some text goes here
text?
Thanks
It depends whether you’re trying to hook to an existing filter or hook to one you’ve made, looking at your second code sample suggests you’re asking about making your own filter.
And, yes you can add your own, something like this is valid inside your loop.
You can then hook that filter, as you would with regular WordPress filters, eg.
Let me know if that helps. 🙂