Viewing 4 replies - 1 through 4 (of 4 total)
  • The only way you’re going to be able to add a CSS rule to hide those codes is if every single article has the same code in the same place. That is, because the container for the shortcode doesn’t have a class or ID associated with it (or any other attribute), then you can’t create a specific selector for a CSS rule to act on.

    Now, if all of your imports have the same structure, i.e., they all imported in that same code in the same place, then you could add a rule like this:

    .single-post .td-post-content > p:nth-of-type(2) {
       display: none;
    }

    That rule hides the second paragraph on all blog posts, which is where the shortcode is appearing on the two examples you’ve posted. The problem is that if the shortcode doesn’t appear on the post, then the rule will hide a paragraph that probably has information that you need to display.

    Probably the best thing to do is add some Javascript that searches and removes all paragraph elements which have that fncvideo string.

    Thread Starter acqua

    (@acqua)

    Thank you for your reply much appreciated
    I will go with the js that search and delete that code
    Any plugin available?

    You can use a plugin like Simple Custom CSS and JS to add your own Javascript. Once you install and activate the plugin, add a custom JS module, and add this code to it:

    jQuery(document).ready(function($) {
    
       $("p").each( function(index) {
          strText = $(this).text();
          if (strText.indexOf('fncvideo') != -1) {
             $(this).remove();
          }
       });
    
    });

    This will remove all paragraphs with the string fncvideo.

    Thread Starter acqua

    (@acqua)

    Oh your code works great!
    This got fixed my issue
    thanks a lot

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

The topic ‘Remove code via css’ is closed to new replies.