Jump to content

Add a if else option and dynamic url option??


hash1

Recommended Posts

What im trying to do is make this into an if else statement so that if the "URL" is equal to the "http://www.someurl.com/" below then it echos the array like it already does. I want the else statement to just echo something like the file_get_contents array but minus the $category and $slug variables and also to have the url be dynamic so the original url can be any and not just a "set" url.

 

Or just have the below array be able to have any link instead of the set one.

 

I hope im explaining this right if not I apologize and can go into further detail.

<?php 
    $post_id = get_post($post->ID); // get current post or page
    $slug = $post_id->post_name; // define slug as $slug
    $category = get_the_category($cat_name);
echo file_get_contents('http://www.someurl.com/' . $category . '/watch-' . $slug . '.html?share=embed');
?>

 

Is there a way to do this? I've been stuck on this for awhile now, any help is greatly appreciated!

 

Thanks

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.