Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter AndreasJa

    (@andreasja)

    Ok perfect, thank you for your fast responds @isaumya and an awesome plugin! Thanks.

    Thread Starter AndreasJa

    (@andreasja)

    Thank you @codeamp for the answer.

    I ended up making the changes directly in the plugin code. Even though it’s not “update proof” it will work for now ??

    If anyone else want to know:

    Go to: wp-content\plugins\custom-layouts\includes\template\elements

    -> class-custom-field.php

    -> row 83 change to be:

    $target = ' target="_blank" rel="nofollow noopener sponsored"';

    Thread Starter AndreasJa

    (@andreasja)

    Hello again! Are there no solution for this? Thank you in advance.

    Thread Starter AndreasJa

    (@andreasja)

    Many thanks for the help Ross! This works great and I will mark as resolved, thanks again.

    I saw your question here I hope It’s ok that I answer you. I do this a lot in my layouts/templates, so hope this helps:

    – Set the custom field to be “Field Type: Url” in ACF.
    – In your Custom Layouts Template:
    + Add element “Custom Field”
    + Set “Custom Field” to be be your custom field (search for it, should be without _ in the start)
    + Set “Data type” to be “Link”
    + Set “Label” to be your link text, for instance “Click”.

    Thread Starter AndreasJa

    (@andreasja)

    So, I came up with a workaround by adding the custom field “list_number” to regual Posts as well and gave the field a Default Value “0” in ACF, and then used $query_args[ 'orderby' ] = 'meta_value_num date'; to order by date when all the posts have the same number.

    Now the custom post types Products, Gifts, Toplists will order by the numbers I give them, and posts will order by date.

    function layout_query_args( $query_args ) {
    	// Modify the query args
    
    	$query_args[ 'meta_key' ] = 'list_number';
    	$query_args[ 'orderby' ] = 'meta_value_num  date';
    	$query_args[ 'order' ] = 'DESC';
    
    	// Always return in WP filters
    	return $query_args;
    }
    
    add_filter( 'custom-layouts/layout/query_args', 'layout_query_args', 10 );

    But, is there another better way to do this or should I stick with this solution? Thanks!

    Thread Starter AndreasJa

    (@andreasja)

    Hello!

    Thank you for the reply and help.

    I use ACF and I create the layouts via admin pages and insert shortcodes.

    I tried it but as you said it applied to all my layouts and the one that do not have the custom field “list_number” did not show any content at all.

    —–
    Will try to explain how I use it, it’s on localhost right now so can’t show you.

    I have three custom post types called Products, Gifts, and Toplists. These are for products (a little bit like thisiswhyimbroke.com) and I use your plugin to display the products with different custom fields. (I will buy your search and filter plugin too soon to use on some places on the website)

    But I also use your plugin to display regual post grids.

    The “Products”, “Gifts” and “Toplists” custom post type grids I would like to orderby the custom field “list_number”, #1,#2,#3 etc.

    But the regual grids with posts I want to order by Published Date. If this is possible.

    I tried

    function layout_query_args( $query_args ) {
    	// Modify the query args
    
            $query_args['post_type'] = array( 'products', 'gifts', 'toplists' );
    	$query_args[ 'meta_key' ] = 'list_number';
    	$query_args[ 'orderby' ] = 'meta_value_num';
    	$query_args[ 'order' ] = 'DESC';
    
    	// Always return in WP filters
    	return $query_args;
    }
    
    add_filter( 'custom-layouts/layout/query_args', 'layout_query_args', 10 );

    and

    function layout_query_args( $query_args ) {
    	// Modify the query args
    
    global $post;
    if ( $post->post_type == 'products', 'gifts', 'toplists' ) {
    
    	$query_args[ 'meta_key' ] = 'list_number';
    	$query_args[ 'orderby' ] = 'meta_value_num';
    	$query_args[ 'order' ] = 'DESC';
    
    }
    
    	// Always return in WP filters
    	return $query_args;
    }
    
    add_filter( 'custom-layouts/layout/query_args', 'layout_query_args', 10 );

    But that did not work.

    Hope you understood my long text, and thank you again for the help!

    I have the same problem too.

    I have noticed that when im browsing my site in incognito mode, the problem appears 100% of the times. But when im browsing ‘normal’ it never appears for me. So it seems that once Ive visited the site it is normal, but for a “new” user the overlapping occurs the first visit.

    Any ideas? ??

    Thread Starter AndreasJa

    (@andreasja)

    I fixed it, dont really know what I did.. but it works ??

    Thread Starter AndreasJa

    (@andreasja)

    I totally understand! Can I email you the login? ?? Thanks

    Thread Starter AndreasJa

    (@andreasja)

    Okey, thanks ??

    I tried to remove <div id="teaser-holder" class="row"> completly, but it didnt work.

    How to make it the wrapper for the ajax load more content? I tried to put it in ajax-load-more.php at "$ajaxloadmore = '<div id="ajax-load-more" class="...." But it still breaks the row.

    Thanks for your help!

    Thread Starter AndreasJa

    (@andreasja)

    I think i solved it. It works, but i dont know if its the right way to do it.

    I used this code in my index.php where i wanted the “XX shares” to display.

    <?php $meta_values = get_post_meta( $id, 'shares', true ); ?> 
    
    <?php if ( get_post_meta( $id, 'shares', true ) ) : ?>
      <?php echo get_post_meta ( $id, 'shares', true ) . ' shares';?>
    <?php endif; ?>

    Hi Peter!

    I really love the plugin, very nice and clean look ??

    But im having the same problem as n3ko, the social counts doesnt appear. Is there anyway to resolve this problem? I really want to use the plugin, but i need the count :/

    Thanks!

    /Andreas

Viewing 13 replies - 1 through 13 (of 13 total)