Unable to process php via shortcode

The problem is that you are using file_get_contents() which only gets the content of the file (hence the name) if you need to render(evaluate and process the php file) then just use include(). But also if your cup_bc_layout.php file echo’s out something then you should put the include inside an object buffer and then return … Read more

Strip Paragraph Tag

strip_tags — Strip HTML and PHP tags from a string if (!empty($post->post_excerpt)) { $excerpt_raw = strip_tags(get_the_excerpt()); echo $excerpt_raw; }

Unable to Find Space in Custom Function

Ok, well it turns out it has more to do with WordPress then we realised. The wp_link_pages function, in which the hook being used in the question resides, is the culprit rather than anything you’ve done. If you want to have a look, the function is in the post-template.php file inside the wp-includes directory. The … Read more

Last class on last headline?

$count = 1; is set in the while loop, so every time the loop runs it sets to 1 again. Place it before your loop and it will work. $count = 1; if (have_posts()) : while (have_posts()) : the_post(); Ow and the $count++ is outside the loop so it will only run after all the … Read more

Can a page contain php code?

You can’t use PHP in the WordPress back-end editor. Maybe with a plugin you can, but not out of the box. The easiest solution for this is creating a shortcode. Then you can use something like [input type=”text” name”from”] in your editor. function input_func( $atts ) { extract( shortcode_atts( array( ‘type’ => ‘text’, ‘name’ => … Read more

Echo title attribute php

Not exactly wordpress question, more of a php but – The syntax for echo is quit simple : You start with a quotation mark, and close with a quotation mark. But since INSIDE the HTML we also need quotation marks , we separate them by using the single ‘ for PHP and the double ” … Read more