Log IP of users who click a button? [closed]

It depends on how the button works. For instance, you can make an API. When the button is clicked, you can call the api via Ajax and save the IP during the process. Or most likely you will write ip via action hook, if the button call the hook. In this case, you will use … Read more

img src not working correctly in custom post type

Add this following function to your functions.php of your theme or child theme. function homeURLshortcode() { return home_url(); } add_shortcode(‘homeurl’, ‘homeURLshortcode’); This will create a shortcode like [homeurl] which you can use to add in any visual editor and it will render as your main domain address, like http://domain.com. So for your image url you … Read more

Parse error: syntax error, unexpected ‘endforeach’ (T_ENDFOREACH) in [closed]

When you use endforeach;, you have to use : instead off { when starting the foreach. <ul class=”project-extension-side-link”> <?php foreach($projectextensions as $projectextension) : // <— ?> <li <?php echo ($section==’project-extension’ ? ‘class=”active”‘: ”); ?>><span>Project 1</span></li> <li><a href=””><?php echo $projectextension->post_title; ?></a></li> <li><a href=””>Project 3</a></li> <li><a href=””>Project 4</a></li> <li><a href=””>Project 5</a></li> <li><a href=””>Project 6</a></li> <?php endforeach; ?> … Read more

Add category image before post title on homepage

This is easily done using a filter on the title, which you can add to your functions.php. Like this: add_filter (‘the_title’, ‘wpse305812_add_flag’, 10, 2); function wpse305812_add_flag ($title, $id) { if (in_category (‘england’, $id)) $flag = “http://www.example.com/…/england.jpg” elseif (in_category (‘brasil’, $id)) $flag = “http://www.example.com/…/brasil.jpg” …; return ‘<img src=”‘ . $flag . ‘”> ‘ . $title; } … Read more

wordpress images not display [closed]

Check if you have images in your uploads folder Media > Settings set your folder to where the images are, if there is no option chech the url under wp-options in mysql 3.In your /wp-content folder, you should find your /uploads folder. Check the permissions assigned to this folder. If it’s anything other than 755 … Read more