Add custom css to theme

You need to make sure that your css goes between style tags. Try changing this line: .btn { background-color:<?php echo esc_attr($btn_color);?>; } <?php to <style>.btn { background-color:<?php echo esc_attr($btn_color);?>;</style> } <?php

Listing categories on a wordpress page

FOR : category display horizontally. This code put into the function.php file. Create a function for list of category. function category_name(){ $cat = get_terms(array(‘taxonomy’=>’category’)); echo ‘<div clss=”design”>’; foreach($cat as $ca){ echo ‘<span>’; echo $ca->name.’&nbsp&nbsp’; echo ‘</span>’; } echo ‘</div>’; } After put this code call the function echo category_name(); when you get the list of … Read more

Moving Large Number of WordPress posts from One wordpress site to another existing wordpress site

In the WordPress admin of the new site, go to Below Steps For Export Steps Tools>Export(Choose What to export). Click “Download Export File” and save the file. Tools>Import. Select “WordPress“, install the importer by clicking “Install” in the popup, and “Activate Plugin & Run Importer“. select the file to upload (the one you just downloaded). … Read more

How to make temporary expiring link for a downloadable file

Option 1: You can achieve this using htaccess if you have single download file/path. But if you have more files available for download. Creating a temporary file for each download requests and using htaccess is not a good idea. $path=”uploads/”; $actualfilename=$path.$filename; $fakefilename=”downloadfile.pdf”; if($typeofview==”download”) { @readfile($actualfilename); header(‘Content-type: application/pdf’); header(‘Content-Disposition: attachment; filename=”‘ . $fakefilename . ‘”‘); header(‘Content-Transfer-Encoding: … Read more