with PHP within splits the link

What you are doing isn’t ever going to work the way you want. the_terms() is going to produce a list of complete a tags so you can’t nest or merge it with another one like you are trying to do. And there are no convenient arguments or filters that would allow you to alter that … Read more

Splitting the_content() by size?

The function assumes wpautop filter on the_content is sitting at priority 10, where WP adds it. If, for any reason, it has been moved at another priority, the filter below should be adjusted to happen after wpautop. The function filters the_content if we are in frontend and we are on a singular post/page (feel free … Read more

Live search from database table

So in php it needs to be: $query = ‘SELECT Location FROM locations’; $result = mysqli_query($link, $query); $rows = array(); while($r = mysqli_fetch_assoc($result)) { $rows[] = $r[‘Location’]; } and jquery ui autocomplete: $(“#location1”).autocomplete({ source: <?php echo json_encode($rows);?>, // this part is only if you want to force autocomplete select change: function (event, ui) { if(!ui.item){ … Read more

Search only working on front page (index) , not working on other pages

Currently your form looks like: <form id=”search-query”> <p class=”in-english”><a href=”http://localhost/hermodswp/?page_id=76″>Information in English</a></p> <div class=”search-box”> <div> <label class=”screen-reader-text” for=”s”></label> <input type=”text” value=”sdf” name=”s” id=”s” style=”width: 293px;”> <input type=”submit” id=”searchsubmit” value=”Sök”> </div> </div> </form> Try adjusting your submit action to point to your home_url(). action=”<?php echo home_url(); ?>” You can edit the page in Chrome to see … Read more

How to change layout of shop page in wordpress? [closed]

Don’t use jQuery to place a image into your shop page (since there is proper way to do this). Instead read the template override methods in Woocommerce: https://docs.woothemes.com/document/template-structure/ Copy woocommerce folder into your theme (if you don’t have the folder inside main theme/child theme). Navigate to your_theme/woocommerce/templates/archive-product.php (this is just an example on how to … Read more

PHP Output also in Child theme, but different

You need to make the function pluggable, that means, to support child themes, the functions in parent theme should use: if ( !function_exists( ‘function_name’ )) { function function_name() { //Stuffs } } You should have seen a PHP Error message if you have debugging enabled. EDIT: The below code snippet if to answer your other … Read more

How to use functions [closed]

To answer your question, the current method would be to create the object then call the method: $objClassName = new ClassName(); $var = $objClassName->updateRegularBalance(5); Another way would be to make the method static since the class has no private data(In your case) to rely on: public static function updateRegularBalance($amount){} This can then be called like … Read more

php – Plugin/theme relative PATH/URI

Just don’t do it, you can never know if the plugins directory is even “below” ABSPATH, and you can not know the URL out of the directory path https://codex.wordpress.org/Determining_Plugin_and_Content_Directories. Just use the core api of plugins_utl etc, don’t reinvent the wheel.