Adding custom url to readmore link using get_permalink()

I suspect the issue is that $recipe_url is undefined in the portion you’re trying to echo it. Can you post a link to the full code of recipe_options.php? Use pastebin or something. Try: href=”https://wordpress.stackexchange.com/questions/114230/<?php $recipe_detail_xml = get_post_meta($post->ID,”recipe_detail_xml’, true); $cp_recipe_xml = new DOMDocument (); $cp_recipe_xml->loadXML ( $recipe_detail_xml ); $recipe_url = find_xml_value($cp_recipe_xml->documentElement,’recipe_url’); echo $recipe_url ; ?>”

Unnecessary url

Always include http:// in your URLs. Change www.youtube.com in http://www.youtube.com/ or even better http://youtube.com/ If you forget the http:// then the data is being parsed like it is another page on your website rather than an external website, that’s why you’ll see 192.168.1.100/wordpress/www.youtube.com

Use an anchor link to open an iframe inside a WordPress page

I would approach this one of two ways: Use a target attribute in the link to open it in an iframe (not universal across browsers) Use JavaScript to replace the src attribute on your iframe Option 1: <a href=”https://wordpress.stackexchange.com/questions/118983/somethirdpartysite.com/reg” target=”thirdparty”>Register</a> <iframe name=”thirdparty”></iframe> Option 2: <a href=”https://wordpress.stackexchange.com/questions/118983/somethirdpartysite.com/reg” class=”iframeit”>Register</a> <iframe src=”#” name=”thirdparty”></iframe> <script> $(‘.iframeit’).click(function(event) { event.preventDefault(); var … Read more

Preventing Canonical Redirect for CDN

This can not work in the way you want. If wordpress is on example.com then all the auto generated links will point to example.com even for pages that are on the CDN under the www.example.com domain. This will result that after the first page being served from the CDN many other pages will be served … Read more

How to add PHP pagination to wordpress

you can use paginate_links() from wordpress core API, its make more easily to paginate your custom query. And you dont need to make another query to get all users count. <?php $users_per_page = 10; // total no of author to display $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; if( (int)$paged === 1 ){ $offset = … Read more

How do I include an external PHP file in a subdir WordPress install?

In you case I’d edited my wp-config.php, and just after if ( !defined(‘ABSPATH’) ) define(‘ABSPATH’, dirname(__FILE__) . “https://wordpress.stackexchange.com/”); I’d added $path = explode( basename( dirname(__FILE__) ), ABSPATH ); define( ‘MYSITEROOTPATH’, $path[0] ); after that, everywhere I need, I’d used // file.php is name of a file in root directory include( MYSITEROOTPATH . ‘file.php’);