Support » Plugin: Latest Post Shortcode » image widith

  • Resolved dulleca

    (@dulleca)


    Hello, I put the shortcode in the sidebar but it appears like this:

    https://ibb.co/d7ryMKG

    other widgets appear normal and take the full width in the sidebar, how can I fix this?

    Thank you

    note: can’t give the URL in question because it’s under development.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi,

    From the image, I can understand that the wrapper element is too small. Can you inspect the elements and see if there is any max-width set there. Also, what shortcode attributes do you use? Are you using columns?

    Regards,
    Iulia

    Thread Starter dulleca

    (@dulleca)

    Hi,lulia

    I checked the columns and it’s fixed now.
    https://ibb.co/6R8mxV8

    I have another two questions and will be appreciated if you answer them:

    1 – I want to implant the shortcode under the post, I’ve already tried putting the shortcode using a hook in function.php file but it didn’t work, how can i do that? ( I’m using generatepress theme)

    2 – how to control post title size? using a css code class or editing the shortcode?

    Thank you.

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Can you show me the code you add in the functions.php to display the shortcode output?
    For the post size title, it depends a lot on what the shortcode exposes, like what other elements you display, and the limits you apply in the shortcode attributes. The title element can always be targeted in your CSS and change there how that to be shown, but I would need an explicit example to work with.

    Thread Starter dulleca

    (@dulleca)

    i used something like this with varietes of the shortcode:

    add_action( ‘generate_after_content’,’re_post_un’ );
    function re_post_un() { ?>
    [latest-selected-content limit=”4″ display=”title” titletag=”strong” url=”yes” image=”thumbnail” elements=”3″ css=” align-right as-overlay tall” type=”post” status=”publish” orderby=”dateD”]
    <?php }

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    To make it work you have to do something like this:

    
    add_action( 'generate_after_content', 're_post_un' );
    function re_post_un() {
    	echo do_shortcode( '[latest-selected-content limit="4" display="title" titletag="strong" url="yes" image="thumbnail" elements="3" css=" align-right as-overlay tall" type="post" status="publish" orderby="dateD"]' );
    }
    

    So, use the WordPress do_shortcode native function that transforms the shortcode string into the output.

    Let me know if this works.

    Regards,
    Iulia

    • This reply was modified 1 year, 3 months ago by Iulia Cazan.
    Thread Starter dulleca

    (@dulleca)

    Works very well.

    Thanks again, keep it up.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘image widith’ is closed to new replies.