Include a page’s “category” in its URL
Include a page’s “category” in its URL
Include a page’s “category” in its URL
Want to add new label in new post
Turns out this was caused by the following custom theme filter in functions.php. Commenting out fixed the problem. function image_alt_tags($content) { global $post; preg_match_all(‘/<img (.*?)\/>/’, $content, $images); if (!is_null($images)) { foreach($images[1] as $index => $value) { if (!preg_match(‘/alt=/’, $value)) { $new_img = str_replace(‘<img’, ‘<img alt=”‘ . get_the_title() . ‘”‘, $images[0][$index]); $content = str_replace($images[0][$index], $new_img, $content); … Read more
For some reason this code has been added: <h1 class=”entry-title”><?php echo the_title(); ?></h1> the_title will display the current posts title, you should replace this with what you actually want. If you wanted to remove this completely with no replacement just delete this line. Also, this doesn’t appear to be a link at all, just a … Read more
Post title not displaying as recorded in the wp_posts table
You may use string comparison. I could illustrate a simple example code. It is assumed that the user with the following knowledge/experience PHP – understand what is variables, static value WordPress templates and how to modify them There are many ways to test string such as php string comparison strpos() (simple) php regular expression preg_match() … Read more
Oh! Thanks God. I could finally fix it myself. Below is the working code: I had a lot of stress being stuck. I share it to help any one who likes to have a fully functional custom popup without any plugin. below is the code. If you are interested just ask me the css for … Read more
Try using following code: add_filter(‘the_title’, ‘mod_product__title’, 10, 2); function mod_product__title($title, $id) { if( is_product() ) { if(preg_match(‘/[^(:|.)]*/’, $title, $matches)){ return trim($matches[0]); }else{ return $title; } } return $title; } Here I’m using regex to match . or : . Regex will match only the first occurrence and return the text before it. Then I’m using … Read more
Fixed the bug, pasting the solution here. <?php if (is_front_page()) { echo ‘Home | ‘; bloginfo(‘name’); } else { wp_title(‘ | ‘, true, ‘right’); bloginfo(‘name’); } ?>
Time Stamp In A WordPress Post Title That Does Not Keep Refreshing