Forum Replies Created

Viewing 15 replies - 1 through 15 (of 36 total)
  • Thread Starter ekajatik

    (@ekajatik)

    So to be clear, on the product page an author needs to decide which of the attributes to complete for only that product type? Is that how users currently manage the attributes of different product types?

    Thread Starter ekajatik

    (@ekajatik)

    Great work Bill, many thanks.

    Thread Starter ekajatik

    (@ekajatik)

    Hi Bill, does it support both CPT’s and custom taxonomies at the same time, e.g. [display_posts post_type=”whatever” taxonomy=”color” tax_term=”blue”] ?

    Thread Starter ekajatik

    (@ekajatik)

    bump

    Thread Starter ekajatik

    (@ekajatik)

    I saw that yes, but also saw that the developer had decided to try to bring it into line with standard CF and put them in the right tables but he cannot and is asking for users to help out.

    marked as resolved, thanks for the help.

    Thread Starter ekajatik

    (@ekajatik)

    $link = get_field(‘links’);

    works. I may have to live with the conflict to be honest as ACF does not store CF values in the normal way but in its own data tables (just discovered), so extremely wary of fiddling with it.

    Will point the ACF dev to this thread and see how it goes.

    Lastly, how do I get the if/then statement to show default text if value missing, in this format:

    <?php
    $link = get_post_meta( get_the_ID(), 'links', true );
    if(isset($link) && $link ) :
    	$args=array(
    		'title_li' => 0,
    		'categorize' => 0,
    		'category_name' => 0,
    		'category' => $link,
    		'show_images' => 0,
    		'show_description' => 1,
    		'after' => '<br />',
    		'between' => '  ',
    		'orderby' => 'url'
    	);
    	wp_list_bookmarks( $args );
    endif;
    ?>

    Thank you big bagel and Digital Raindrops, for your time and attention. Much appreciated ??

    Thread Starter ekajatik

    (@ekajatik)

    I installed ‘Easy Content Types’ plugin for managing post types, installed last week, and now realise that this has CF functionality also (they call it metaboxes), could there be a conflict? Tried deactivating but no change.

    Thread Starter ekajatik

    (@ekajatik)

    So… created a new CF, added variable, changed CF name in code and result? No working.

    Added var dump (most of the content onscreen is through CF’s so loads of results, except for links or the new CF I just created ‘links_category’… both missing.

    I have a number of unused CF’s which I created originally so I changed the name in the code to the unused one and added the link category variable and yes, it works!

    So I then changed the name of this unused CF and name of the slug, to ‘web_links’ and guess what… not working again.

    BTW, am using Advanced Custom Fields 2.0.5

    Thread Starter ekajatik

    (@ekajatik)

    exact code I used:

    <?php
    $test_id = get_the_ID();
    $test_keys = get_post_custom_keys( get_the_ID() );
    $test_value = get_post_meta( get_the_ID(), 'links', true ); echo '<!--test id--' . $test_id . '-->'; echo '<!--test keys--' . $test_keys[0] . '-->'; echo '<!--test value--' . $test_value . '-->';	 												?>
    <?php the_field('links'); ?>
    Thread Starter ekajatik

    (@ekajatik)

    Deactivated w3 Cache and CDN.
    Added testing code which returned the following:

    <!–test id–1316–><!–test keys–_jd_post_meta_fixed–><!–test value—->

    So the method is not getting the CF value.

    Just to be sure I also used the get_field for the link CF and this shows fine the right CF value.

    Thread Starter ekajatik

    (@ekajatik)

    Looks great, just like my code etc, except mine has no output.

    So I am trying it a different way… since I cannot execute php in custom fields I am using the WP-Render-blogroll shortcode in the CF like so:

    [wp-blogroll catid=366 showdesc=1 notitle=1]

    Then using the following to do the shortcode properly:

    <?php echo apply_filters(‘the_content’, get_post_meta($post->ID, ‘links’, true)); ?>

    But that’s not working either! Nothing showing up. The shortcode definitely works on pages.

    Thread Starter ekajatik

    (@ekajatik)

    There is no page cache issue… other small changes have been made to template pages and posts and the results are immediate as I flush the cache as necessary.

    Custom field name is definitely ‘links’
    Custom field value is definitely 366.

    Also, I tried your troubleshooting code above and it produced absolutely nothing in the source code… I put it in below the list_bookmarks as follows:

    <?php $test_id = get_the_ID(); $test_keys = get_post_custom_keys( get_the_ID() ); $test_value = get_post_meta( get_the_ID(), 'links', true ); echo '<!--' . $test_id . '-->'; echo '<!--' . $test_keys[0] . '-->'; echo '<!--' . $test_value . '-->'; ?>

    Also, Digital Raindrops, I tried your ‘easy read’ code above, but has same result as other code, no links are displayed.

    Thread Starter ekajatik

    (@ekajatik)

    Must be the $link that is the issue as the following outputs only the links in category 366:

    <?php wp_list_bookmarks('title_li=0&categorize=0&category_name=0&category=366&show_images=0&show_description=1&after=<br />&orderby=url'); ?>

    Thread Starter ekajatik

    (@ekajatik)

    Hi Bagel

    All the above, check.
    Working? No.

    Have triple checked. The code block contains the semi colon (not sure how it disappeared in my post above), it is in the loop, the CF field name is definitely ‘links’, the Value is 366 which corresponds to links category 366 which contains one link with description.

    Tried:

    1. Removing this line:
    else { echo '<em>No links have been submitted and approved yet.</em>'; }
    still does not return the link, just has a blank space where the link should be.

    2 Key problem is that this does not work and returns all links regardless of category:

    <?php
    $link = get_post_meta( get_the_ID(), 'links', true );
    wp_list_bookmarks("title_li=0&categorize=0&category_name=0&category=$link&show_images=0&show_description=1&after=<br />&between=&nbsp;&nbsp;&orderby=url"
    );
    ?>

    so &category=$link is not working?

    Thread Starter ekajatik

    (@ekajatik)

    <?php
    $link = get_post_meta( get_the_ID(), 'links', true )
    if ( $link ) {
    wp_list_bookmarks(
    "title_li=0&categorize=0&category_name=0&category=$link&show_images=0&show_description=1&after=<br />&between=??&orderby=url" );
    } else {
    echo '<em>No links have been submitted and approved yet.</em>';
    }
    ?>

    posts with no CF value showing the default text, fine. However, posts with CF value and links in that category are also showing the ‘else’ version. Example: https://www.heritagetraveller.com/europe-world-heritage-site/fortifications-vauban/ definitely has links in the category defined in the CF

Viewing 15 replies - 1 through 15 (of 36 total)