What are you actually trying to accomplish?
* function definitions belong in functions.php.
* function calls can go in template files.
* get_template_part() is a wrapper for PHP include(), which includes an entire PHP file.
* the href attribute expects a URL.
So, what are you trying to do here? If you can explain that, we can help you accomplish it.
Ok, I’m not a pro in wordpress but I’ll try to explain! 😀
After the click on “a” I should run just the code inside loop-blog.php.
Belove the same page I have this code and it works perfectly.
<div id="content_post">
<?php get_template_part( 'loop', 'blog' ); ?>
</div>
I should do the same thing clicking on “a”.
I hope to have made you understand…. 🙁
No, I really don’t understand.
Don’t speak in terms of code; speak in terms of what’s physically happening.
Clicking on a link would take the user to a different page. Are you wanting to specify the page to which the user is taken?
No, clicking on “a” link should just run the code inside the file loop-blog.php into another page.
No, clicking on “a” link should just run the code inside the file loop-blog.php into another page.
But why? Why are you trying to do that?
If you need to link to something, then link to it. If you need to include some PHP code, then include it. Why are you trying to use an HTML anchor to include PHP code?