Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1303624

    Hi,

    I wonder if it’s possible to add custom fields to the metadata shortcode selection?
    This is the Selection where I want to make custom field also selectable

    Thanks,
    Sebastian

    #1304328

    Hey emilconsor,

    Thank you for the inquiry.

    This should be possible but it will require modification that is beyond the scope of support. You can start by editing the config-templatebuilder/avia-shortcodes/post_metadata/post_metadata.php, and include another condition and the function that renders the output in this block.

    switch( $meta['metadata'] )
    				{
    					case 'author':
    						$out = $this->author( $meta );
    						break;
    					case 'categories':
    						$out = $this->taxonomies( $meta, 'categories' );
    						break;
    					case 'tags':
    						$out = $this->taxonomies( $meta, 'tags' );
    						break;
    					case 'comments':
    						$out = $this->comments( $meta );
    						break;
    					case 'revisions':
    						$out = $this->revisions( $meta );
    						break;
    					case 'published':
    					case 'published time':
    					case 'modified':
    					case 'modified time':
    						$out = $this->date_time( $meta );
    						break;
    				}
    

    For example, if you select Author, the switch function above will resolve to get the output of the protected function author and include the associated output in the final html. You can include another condition for custom fields and define your own function that returns the output.

    Best regards,
    Ismael

    #1304409

    Hi Ismael,

    thanks for the answer.
    I guess It’s too much of a hassle.
    But thanks anyway.

    Sebastian

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Add Custom Field to Post Meta Date Shortcode’ is closed to new replies.