[Resolved] show custom fields on post

Home Forums Support show custom fields on post

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #328142
    Eduardo

    Hi,
    I dont why, custom fiels are not showed in posts with your template.
    I use Advanced Custom Fiels plugins and its worked perfect with my previous template before installing yours.

    GeneratePress 1.3.46
    GP Premium 1.3
    #328144
    Leo
    Staff
    Customer Support

    Hi there,

    Just tested and it’s working for me.

    Did you create a Custom Field group within the plugin as #3 here?
    https://en-ca.wordpress.org/plugins/advanced-custom-fields/#installation

    Then it should appear on the page / post / template as #4 suggested:
    https://en-ca.wordpress.org/plugins/advanced-custom-fields/#installation

    #330917
    Eduardo

    Hi, Everything its ok.
    If i change the template I can see the custom fields on Post but not with your template.
    Please, tell me something because clients are calling me.
    You can check it, for example here: http://www.guia-clubs.com/club-amor-secreto-valencia/
    Thanks

    #330918
    Eduardo

    This is the code whith your theme:

    <div class="site-content">
    <div class="content-area grid-parent mobile-grid-100 push-25 grid-75 tablet-push-25 tablet-grid-75">
    <main id="main" class="site-main">
    <article id="post-1525" class="post-1525 post type-post status-publish format-standard has-post-thumbnail hentry category-clubs-alterne-spain" itemtype="http://schema.org/CreativeWork" itemscope="itemscope">
    <div class="inside-article">
    <header class="entry-header">
    <h1 class="entry-title" itemprop="headline">CLUB AMOR SECRETO – VALENCIA</h1>
    <div class="entry-meta"> </div>
    </header>
    <div class="page-header-image-single page-header-below-title grid-container grid-parent generate-page-header">
    <img src="http://www.guia-clubs.com/wp-content/uploads/2017/05/puticlub-amor-secreto-valencia.jpg" alt="Club Amor Secreto Valencia" width="650" height="463" />
    </div>
    <div class="entry-content">
    <p>Nuestro objetivo es lograr que usted viva experiencias únicas, sus momentos ‘Amor Secreto’, de la forma más cómoda. Conoce a las mejores escorts deluxe y nuestros servicios complementarios al de acompañamiento. Siempre en un marco de confianza y discreción.</p>
    <div class="adsb30">
    <style>
    </div>
    <footer class="entry-meta">
    </div>
    </article>
    <div class="comments-area">
    </main>
    </div>
    #330919
    Eduardo

    And this is the code with another template (hotec):

    <div class="page-wrapper twelve columns page-wrapper-left-sidebar b0">
    <div class="row">
    <div class="twelve columns b0">
    <div class="page-title-wrapper">
    <h1 class="page-title left">+ INFORMACIÓN Y COMENTARIOS</h1>
    <div class="page-title-alt right"></div>
    <div class="clear"></div>
    </div>
    </div>
    </div>
    <div class="row">
    <div class="content-wrapper eight columns b0">
    <div class="post-heading">
    <h1 class="blog-title"> CLUB AMOR SECRETO – VALENCIA </h1>
    <div class="blog-meta">
    <span class="blog-date">
    <span class="blog-author">
    <span class="blog-comment">
    <span class="blog-category">
    </div>
    <p>Dirección: Calle de la Iglesia del Rosario, 18, Valencia, España</p>
    <p>Teléfono: 963 242 696 y 636 473 976</p>
    </div>
    <div class="page-content">
    <div class="page-single-element">
    <p class="page-tags"> </p>
    <div class="clear"></div>
    <br>
    <div>
    <h3 id="comments" class="meta">
    <div>
    </div>
    </div>
    </div>
    <div class="left-sidebar-wrapper four columns b0">
    <div class="clear"></div>
    </div>
    </div>
    <div class="clear"></div>
    </div>
    </div>
    #331143
    Tom
    Lead Developer
    Lead Developer

    How are you trying to add the custom field into the template?

    #331235
    Eduardo

    Please, tell me how can I do it.
    As I tell you, with other templates, custom fields works OK.
    Thanks

    #331403
    Eduardo

    Fixed.
    I wrote on Hook Afer Entry Title:
    <br>
    <p><b>Dirección: </b><?php the_field(‘telefono’); ?><br>
    <b>Teléfono: </b><?php the_field(‘direccion’); ?></p>
    And now custom fiels are showed on post/entries.
    Please tell me if you think this code its ok or maybe you would add or change something to work better.
    Thanks

    #331404
    Tom
    Lead Developer
    Lead Developer

    I’m not sure exactly what you’re trying to do.

    What are you trying to insert? Where are you wanting it to show up?

    If you’re trying to add custom fields into the template, you’ll likely need to use the hook system: https://docs.generatepress.com/collection/hooks/

    #331405
    Tom
    Lead Developer
    Lead Developer

    Ha! Beat me to it. Looks good 🙂

    #331414
    Eduardo

    Now I saw a problem.
    I want show custom fields just on Post/Entries but, now, custom fields are showed on Pages too.
    Please, can you tell me howcan I fis this problem?
    Thanks

    #331416
    Tom
    Lead Developer
    Lead Developer

    Try this:

    <?php if ( is_single() ) { ?>
        Stuff in here will show on single posts only.
    <?php } ?>
    #331428
    Eduardo

    Perfect!
    One more thing. How can I hide nav post navigation on posts?
    Thanks

    #331604
    Tom
    Lead Developer
    Lead Developer

    Try this:

    .post-navigation {
        display: none;
    }
    #331887
    Eduardo

    Thanks

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.