Permalink of a page or post using ID can be retrieved as follows:
$url = get_permalink($post_id);
Where $post_id is the ID of the post or page whose permalink is to be get.
Learn web technologies like Drupal, WordPress, PHP, Magento, ReactJS, JQuery, Magento, Javascript, HTML, CMS, Website building and also learn more about CRM like vTiger, Sugarcrm, salesforce, Zohocrm and many more.
Permalink of a page or post using ID can be retrieved as follows:
$url = get_permalink($post_id);
Where $post_id is the ID of the post or page whose permalink is to be get.
To get values of ACF field from another page or post use the following method.
$value = get_field('field_name',$post_id);
Here $post_id is of another post or page whose ACF value you want to fetch in the current page or post.
To get the website URL use the following inbuilt function of WordPress.
$site_url = site_url();
You will value of site URL in the above variable and can be used as following:
<?php echo $site_url; ?>
As we know WordPress is a very powerful blogging open source CMS, so is development easy and flexible.
To get the home page URL use the following function.
$home_url = home_url();
<?php echo $home_url; ?>
You will get the home URL in the above variable.
function doc2text($file)
{
$file = $directory.'/'.$filename;
$fileinfo = pathinfo($filename);
$content = "";
// doc to text
$content = shell_exec("antiword -m UTF-8.txt -t $file");
return $content;
}
The usage of the function is as follows:
$file = "documents/files/doc/test.doc";
doc2text($file);
Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...