• I started a blog recently, and am currently using the theme ‘evolve’, which displays several posts on the main page along with the first few lines of each post.

    Whenever I put any HTML, shortcode, or anything except plain text within those few lines, it is replaced with the characters “/*”.

    How do I prevent this from happening? Ideally I would just want any code to be ignored in the post preview, as I want it to display only the plaintext.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Could you post the url to your site?

    Thread Starter melange

    (@melange)

    https://kiwifoodie.co.nz/

    I had used plaintext for most of my posts to temporarily resolve the issue, but for the ‘Butlers Chocolate Cafe’ post I have put the shortcode back at the top of the post so that you can see what I mean.

    Thanks.

    What shortcode are you using?

    Could you check something for me ? It is a common error with shortcode functions to have them output text rather than RETURN that text.

    Of course you know that /* is the start of a php or css comment

    OR is this in some .php file ? and a php comment has slipped outside a <?php ?> block.

    Thread Starter melange

    (@melange)

    stacy: I am using [portfolio_slideshow] currently. Some other shortcodes also cause this problem but some don’t.

    Ross: How do I diagnose what function exactly is causing the problem?

    (Edited)

    All I can suggest is that you read all the .php files in your (child) theme, view the files in an editor which does colour syntax highlighting.

    Thread Starter melange

    (@melange)

    So I would be looking for a php comment outside a php block, in my theme? But if it were a problem in the theme, why does it not show up if I don’t use a shortcode at the start?

    why does it not show up if I don’t use a shortcode at the start?

    There is a clue here !
    Look especially into the functions that do your shortcodes, and of course any functions they may call.

    (It is in the style of the php language that you can be both within a function (or conditional block) AND also OUTSIDE the language via ?> <?php)

    If it is not too bulky could you post the code here ?

    Thread Starter melange

    (@melange)

    I think the problem lies in the Portfolio Slideshow plugin, as when I try shortcodes for some other plugins (like Universal Star Rating), the post preview is fine.

    There are a lot of files in the Portfolio Slideshow plugin editor though, and I am not good enough with php to discern which one would be causing the problem.

    Good work.
    Suggest that further support migrate to the new thread here: https://www.ads-software.com/support/topic/shortcode-portfolio_slideshow-displaying-as-in-post-preview

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘"/*" characters in post preview on main page’ is closed to new replies.