function post_get_meta_field($value, $post_id, $field_name)
 {
     if (!empty($value)) {
         return $value;
     }
     $children = types_child_posts($field_name, $post_id);
     if (is_array($children)) {
         foreach ($children as &$child) {
             $child = new TimberPost($child->ID);
         }
         $children = array_values($children);
         return $children;
     }
     return false;
 }
    ?>

					<div id="menu-dish-<?php 
    the_ID();
    ?>
" class="menu-dish-wrapper">

						<div class="dish-note"><?php 
    the_content();
    ?>
</div>

						<?php 
    // we create a for loop for callin all dishes children from menu-section
    $args_menu = array('order' => 'ASC', 'posts_per_page' => -1, 'orderby' => 'id');
    $child_posts = types_child_posts('menu-dish', $args_menu);
    foreach ($child_posts as $child_post) {
        ?>
							<div class="menu-dish">
								<div class="menu-dish__description">
									<p class="menu-dish__title">
										<?php 
        echo $child_post->post_title;
        ?>
									</p>
									<p class="menu-dish__ingredients" class="menu-dish__ingredients">
										<?php 
        echo $child_post->fields['menu-dish-description'];
        ?>
									</p>
								</div><!--
Esempio n. 3
0
					</div>
					<div class="Block">
						<div class="Hearing-head Block u-bg-orange u-txt-lightgray">
							<div class="Hearing-headDate Box">Fecha</div>
							<div class="Hearing-headNumOfActs Box">Número de actos</div>
							<div class="Hearing-headRecords Box">Expedientes</div>
							<div class="Hearing-headKinfOfAct Box">Tipo de Acto</div>
						</div>
						<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

						<?php 
        $acts = types_child_posts("acto");
        ?>
						<?php 
        $numOfActs = count($acts);
        ?>
						<?php 
        foreach ($acts as $act) {
            ?>
						<?php 
            $titlesActs[] = $act->post_title;
            ?>
						<?php 
            $kindOfActs[] = $act->fields['tipo-de-acto'];
            ?>
						<?php 
        }
		<div class="featured-image-single">
			<?php 
the_post_thumbnail();
?>
		</div>
		<?php 
the_content();
?>
    <div class="project-downloads">
			<h2 class="project-downloads-title"><?php 
_e('Letöltések', 'fansubpress');
?>
</h2>
			<table class="project-downloads-table">
      <?php 
$downloads = types_child_posts('download');
foreach ($downloads as $download) {
    echo '
					<tr>
						<td>
							<a href="' . get_post_permalink($download->ID) . '">
								' . get_the_post_thumbnail($download->ID, 'project-download') . '
							</a>
						</td>
						<td>
							<a href="' . get_post_permalink($download->ID) . '">
								' . $download->post_title . '
							</a>
						</td>
					</tr>
				';
 *
 * Methods for TimberHelper can be found in the /lib sub-directory
 *
 * @package  wp-softcatala
 */
wp_enqueue_script('sc-js-contacte', get_template_directory_uri() . '/static/js/contact_form.js', array('sc-js-main'), WP_SOFTCATALA_VERSION, true);
wp_enqueue_script('jquery-browser-plugin', get_template_directory_uri() . '/static/js/jquery.browser.min.js', array('sc-js-main'), WP_SOFTCATALA_VERSION, true);
wp_enqueue_script('sc-js-programes', get_template_directory_uri() . '/static/js/programes.js', array('sc-js-main', 'jquery-browser-plugin'), WP_SOFTCATALA_VERSION, true);
wp_localize_script('sc-js-programes', 'scajax', array('ajax_url' => admin_url('admin-ajax.php')));
$context = Timber::get_context();
$post = Timber::query_post();
$context['sidebar_top'] = Timber::get_widgets('sidebar_top');
$context['sidebar_elements'] = array('static/ajudeu.twig', 'static/dubte_forum.twig', 'baixades.twig', 'links.twig');
$context['sidebar_bottom'] = Timber::get_widgets('sidebar_bottom');
$context['post'] = $post;
$post_links = types_child_posts('link', $post->ID);
$context['links'] = $post->get_field('link');
$context['credits'] = $post->get_field('credit');
$baixades = $post->get_field('baixada');
//Contact Form
$context['contact']['to_email'] = get_option('email_rebost');
//Add program form data
$context['categories']['sistemes_operatius'] = Timber::get_terms('sistema-operatiu-programa');
$context['categories']['categories_programes'] = Timber::get_terms('categoria-programa');
$context['categories']['llicencies'] = Timber::get_terms('llicencia');
//Download count
$download_full = json_decode(file_get_contents(ABSPATH . '../full.json'), true);
if ($download_full) {
    $wordpress_ids_column = array_column($download_full, 'wordpress_id');
    if ($wordpress_ids_column) {
        $index = array_search($post->ID, $wordpress_ids_column);
Esempio n. 6
0
				<p><?php 
        echo $staff_feature_text;
        ?>
</p>
			</div>
    		
			<img src="<?php 
        echo bloginfo('template_directory');
        ?>
/assets/img/bg_dj-gray.jpg" alt="DJ in Action" />
    	</section>

		<section class="services-list">
			<h1>Our Services</h1>
			<?php 
        $child_posts = types_child_posts('services');
        if (!empty($child_posts)) {
            ?>
			<ul>
				<?php 
            foreach ($child_posts as $child_post) {
                ?>
					<li>
						<h3><?php 
                echo $child_post->post_title;
                ?>
</h3>
						<p><?php 
                echo $child_post->fields['service_description'];
                ?>
</p>	
<?php

while (have_posts()) {
    the_post();
    ?>
  <article class="story">
  <?php 
    $postid = get_the_ID();
    $fieldArray = array("user_id" => $postid);
    $headerText = types_render_field("header-text", $fieldArray);
    $headerImage = types_render_field("header-image", array("url" => "true", "proportional" => "true"));
    $storyContent = types_render_field("story-content", array("output" => "html"));
    $quotes = types_child_posts("quote");
    $galleryImages = types_child_posts("gallery");
    ?>

    <header class="border" style="background-image: url( <?php 
    printf($headerImage);
    ?>
 )">
      <div>
        <div class="col-sm-6 col-sm-offset-1">
          <!-- <h1 class="entry-title"><?php 
    the_title();
    ?>
</h1> -->
          <h1><?php 
    printf($headerText);
    ?>
</h1>
        </div>
	
	<div class="entry-content">

<!-- Standard Twenty Sixteen content output -->	
		<?php 
/* translators: %s: Name of current post */
the_content(sprintf(__('Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen'), get_the_title()));
?>


<!-- TYPES TIP: Custom section to display a list of child posts ("Books"), belonging to the currently displayed parent post ("Author") -->		
			<h4>Books from this author</h4>
			
			<?php 
// Using the Types function to load the contents of child posts and then starting a custom loop to output them
$child_posts = types_child_posts("book");
// Load the contents of related posts in the array
foreach ($child_posts as $child_post) {
    // Loop through each of the child post in the array
    ?>
			
			<div class="book-listing">
				<h5><?php 
    echo $child_post->post_title;
    // Display the post title of a current child post
    ?>
</h5>
				<?php 
    echo types_render_field("book-cover", array("id" => "{$child_post->ID}", "size" => "thumbnail"));
    // Display the image coming from a custom field of the current child post
    ?>
Esempio n. 9
0
		<h1><?php 
echo $post->post_title;
?>
 </h1>
		<?php 
echo apply_filters('the_content', $post->post_content);
?>


		<?php 
if (types_child_posts('case-study')) {
    ?>
			<div class="service--case-studies-holder row">
				<?php 
    $child_posts = types_child_posts('case-study');
    foreach ($child_posts as $child) {
        ?>
						<div class="col-md-4 case-study">
							<h4> <?php 
        echo $child->post_title;
        ?>
 </h4>
						</div>
					<?php 
    }
    ?>
			</div>
		<?php 
}
?>
function technologyShafts($post_id)
{
    $shafts = array();
    $child_posts = types_child_posts('association', array('orderby' => 'menu_order', 'order' => 'ASC'));
    foreach ($child_posts as $child_post) {
        $shaft_id = wpcf_pr_post_get_belongs($child_post->ID, 'products');
        $shaft = get_post($shaft_id);
        array_push($shafts, $shaft);
    }
    return $shafts;
}
Esempio n. 11
0
        echo $child_post->post_content;
        ?>
 </li>
					<?php 
    }
    ?>
				</ul>
			</div>
			<div class="row" id="preparacion-receta">
				<div class="col-md-12">
					<div class="receta-wrapper">
						<div class="flecha-descripcion"></div>
						<h2 class="obela-bold yellow">Modo de preparación</h2>
						<ul id="receta-preparacion" class="yellow">
							<?php 
    $preparacion = types_child_posts('modo-de-preparacion');
    ?>
							<?php 
    foreach ($preparacion as $child_post) {
        ?>
								<li><div class="white"><?php 
        echo $child_post->post_content;
        ?>
</div></li>
							<?php 
    }
    ?>
						</ul>
						<h2 class="obela-bold yellow">
							Compartir receta
							<a href="https://www.facebook.com/ObelaMX" target="_blank">