• Resolved Rose

    (@eos-rose)


    I’m using the following theme: https://www.ads-software.com/extend/themes/wp-creativix

    For various reasons (primarily being that I have too many posts to create a custom field for the featured image for each), I need to fetch the featured image for the slideshow from the image attachment I’ve applied to each post rather calling on the value of a custom field. Can anyone tell me how to do this without breaking the code? I’ve been doing a little experimenting, but my limited knowledge of PHP seems to be getting in the way.

    Teach me, oh knowledgeable ones!

    Here’s the code I’m looking at in the header.php:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Rose

    (@eos-rose)

    I found a solution! There’s probably a much cleaner way of doing this, but after searching the forums and doing some more experimentation, I made this work for me.

    Insert the following into functions.php:

    function postimage() {
    	if ( $images = get_children(array(
    		'post_parent' => get_the_ID(),
    		'post_type' => 'attachment',
    		'numberposts' => 1,
    		'post_mime_type' => 'image',)))
    	{
    		foreach( $images as $image ) {
    			$attachmenturl=wp_get_attachment_url($image->ID);
    
    			echo ''.$attachmenturl.'';
    		}
    	} else {
    		$bloginfo = bloginfo('template_directory');
    		echo $bloginfo."/images/add-feat.png";
    	}
    }

    Replace the index.php code I indicated in my first post with the following:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    I’m certain that my way makes parts of the code redundant, but the slideshow now draws on attached images rather than a custom field, so yay?

    Also inserting the following code in single.php (or wherever appropriate) will call up the raw image url:
    <?php postimage(); ?>

    Ok, finally got the image to show for the logo. Also discovered that my widgets are not displaying.

    I also need help with this theme. My homepage for this theme is called “Home” and when I click to edit it all it says in the body is “home” as well. Now, when I touch anything and update, even if I immediately undo it and update again, my homepage is changed from the regular themepage with the slider and all that, to a post page Home>Home that just says “Home.”

    So basically, I cannot edit anything on that homepage, whereas I want to add a custom sidebar and prob some other stuff. Is it normal not to be able to add anything to a themese homepage?

    It may be a different topic, but because you are talking about CREATIVIX issues… Can you please help me in inserting and handling the slides in this theme…. I really will be very thankful.

    WebHero, I don’t know much about this theme or code, but I have the option on my posts and pages to just click a box that says “show in slideshow.”
    And then it does.

    Thanks Micdiddy,

    Do you use any related plugin, please let me know the plugin name, so that I can download it and use it.

    Thanks

    I do not.

    Thank you Mickdiddy.

    I am directing the same question to others in the forume ..

    Within the CREATIVIX theme… Any body knows how to insert an image and handling the slide contents ..

    Thank you

    I would like to know the name of the plugin used to manage the contents of the slides in the CREATIVIX theme… any body has an answer ??

    Thank you

    Any body can tell me how to setup one post in such a way that non-members visitors can not post any comments unless agreed by the administrator?

    Once agreed or approved, it is going to be posted automatically.

    Thanks

    Post moderation is in the blog settings. Scroll down to “settings” and choose “discussion.” Click the appropriate checkboxes you want to allow/disallow comments being posted.

    Can anyone tell me how to edit the pictures to fit in slideshow on home page? as well as the side bar to say what i want it to say…customizing it, need help…

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WP-Creativix’ is closed to new replies.