WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
[resolved] How can I call these fields value on a them template.. (4 posts)

  1. Sudhanshu Dubey
    Member
    Posted 1 year ago #

    Hello,

    I found this plugin good but somewhere I got stuck ..Like you didn't mentioned that how can people can call on post,page or even on the template file of theme.Like as for now I have created two many images and made two section repeatedly.and again putted many images in that.Now what I need how to call on template in a loop so that they all could be visible on my front page coming through a template..

    Before of this I have asked another question.Please take me out from this problem..

    Thanks!

    http://wordpress.org/extend/plugins/simple-fields/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, the documentation is lacking in some areas. Sorry about that..

    One simple way to add your images to your posts on the front end is to modify your functions.php and add something similar:

    function add_simple_fields_to_content($content) {
    
    	$images = simple_fields_values('your_images_slug');
    
    	if ( empty( $images ) ) return $content;
    
    	foreach ($images as $image_id) {
    		$content .= sprintf(
    			'<p>%s</p>',
    			wp_get_attachment_image($image_id, NULL, TRUE)
    		);
    	}
    
    	return $content;
    
    }
    add_action("the_content", "add_simple_fields_to_content");

    You may have to modify it a bit to suit your needs, but it should be a good starting point. Good luck!

  3. Sudhanshu Dubey
    Member
    Posted 1 year ago #

    Hi Pär Thernström,

    I am a new in WordPress,But I think you didn't addressed my requirements properly as what I need is:
    1.Multiple group of slection at a time that contains different fields on a single post.Like I have made two groups
    1.single->contains some fields
    2.Doulble->conteins some different fields.

    I want to show both group fields at a time on a single post.

    2.How can I call all fields values on a template not only image field but all fields values and I can't use featured image option in this ..Please help me.

    Thanks!

  4. Sudhanshu Dubey
    Member
    Posted 1 year ago #

    I got the solution thanks!!

    you will get all the stuffs from here :

    http://simple-fields.com/documentation/getting-started/tutorial-part-2/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic