okhalid
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to add a new page to the template?Found the answer: https://codex.www.ads-software.com/Pages
Forum: Fixing WordPress
In reply to: How to get children categories nameThis will give me the children of the category 8 right?
What I want is that once a post is received belonging to child1, then to get it’s category name as child 1 rather then displaying “root” category name!
I have found the solution ??
https://www.ads-software.com/support/topic/246893
By adding the function to my functions.php:
// Get URL of first image in a post
function catch_that_image() {
global $post, $posts;
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/<img.+src=[\'”]([^\'”]+)[\'”].*>/i’, $post->post_content, $matches);
$first_img = $matches [1] [0];// no image found display default image instead
if(empty($first_img)){
$first_img = “/images/default.jpg”;
}
return $first_img;
}I just needed to make the call
<?php echo catch_that_image() ?>
where I needed. This removed a dependency on external plugins and sorted out what I need ??
Thanks a lot to all those who replied to my bost…
I have tried both gi_library(1) and wp_get_attachment_image( 1 )
But no luck ??
Hi,
Thanks for the plug-in information. But it didn’t really help. The way the theme is designed that it needs custom value “leadimage” to be set. So what i am thinking of is that once the simple post thumbnails upload the image, then it automatically creates a custom value for the post by setting “leadimage”. I think this will sort my issue..
Any ideas of about how to do that?
Thanks,
OmerForum: Fixing WordPress
In reply to: Featured Categories MissingHi,
The link to the Mimbo theme is the following:
https://www.darrenhoyt.com/2007/08/05/wordpress-magazine-theme-released/The error I am getting is this:
Warning: Invalid argument supplied for foreach() in /home/public_html/wp/wp-content/themes/mimbo/mimbo/index.php on line 88
All the post appear in the in their respective categories but nothing appears in the featured column.
Thanks for your help!
Omer