Skip to content
Advertisement

Tag: wordpress

Get Category name from Post ID

Is it possible to get the category name of a category given the Post ID, the following code works to get the Category Id, but how can I get the name? Thank! Answer here you go get_the_category( $post->ID ); will return the array of categories of that post you need to loop through the array get_the_category

Redirect /index.php – wordpress

I want that if someone got link to my site, lets say: www.bla.com/index.php , he will redirect to www.bla.com. or in another words – remove the index.php. Here is my .htaccess file: Either if someone got link: www.bla.com/camera/index.php – it will redirect to www.bla.com/camera/. For now, the site itself works great, without index.php, but i want to remove the index.php

Redirect only WordPress homepage with a 301 redirect

I have a blog, lets say example.com and another blog installed in example.com/np which is not multisite but a different WordPress installation. What I want is to redirect example.com homepage only to example.com/np. It would be great if that redirection is a 301 moved permanently redirection. If I place the 301 redirection in WordPress header file, header.php, it will redirect

How to use session in wordpress in plugin development

I am new to write a plugin ..I am having a testplugin.php file and a ajax.php file .. My code in testplugin.php is And my ajax.php consists of following code And if use session_start(); I get following error I just want to send array of data from one file of my plugin to another file … Answer Add following on

file upload to a folder in wordpress

I have use the below written code for move the file to a folder named “training”. To save the image i wrote this But i could not get any result. Did i do any mistake. please help me. This is my entire code Answer You are doing it wrong. $upload_dir[‘baseurl’] gives the URL to the uploads directory not the absolute

Advertisement