Filtering Post Content (Wordpress) The Next CEO of Stack OverflowJavaScript post request like a form submitPUT vs. POST in RESTHow to fix this WordPress function so that it doesn't return a 404 page?add a page to sidebarsimple php counterHow to make HTTP POST web requestHow to retrieve POST query parameters?How is an HTTP POST request made in node.js?How are parameters sent in an HTTP POST request?Trying to display all posts in my archive page but it is only returning the page content

Shortening a title without changing its meaning

Read/write a pipe-delimited file line by line with some simple text manipulation

What did the word "leisure" mean in late 18th Century usage?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Can I cast Thunderwave and be at the center of its bottom face, but not be affected by it?

Gauss' Posthumous Publications?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

Can I hook these wires up to find the connection to a dead outlet?

Was the Stack Exchange "Happy April Fools" page fitting with the 90s code?

Can Sri Krishna be called 'a person'?

Find a path from s to t using as few red nodes as possible

How to show a landlord what we have in savings?

Compensation for working overtime on Saturdays

Is it possible to create a QR code using text?

Why does the freezing point matter when picking cooler ice packs?

How can I prove that a state of equilibrium is unstable?

Can this transistor (2N2222) take 6 V on emitter-base? Am I reading the datasheet incorrectly?

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

Could you use a laser beam as a modulated carrier wave for radio signal?

What steps are necessary to read a Modern SSD in Medieval Europe?

Why does sin(x) - sin(y) equal this?

Is it correct to say moon starry nights?

Direct Implications Between USA and UK in Event of No-Deal Brexit

Does Germany produce more waste than the US?



Filtering Post Content (Wordpress)



The Next CEO of Stack OverflowJavaScript post request like a form submitPUT vs. POST in RESTHow to fix this WordPress function so that it doesn't return a 404 page?add a page to sidebarsimple php counterHow to make HTTP POST web requestHow to retrieve POST query parameters?How is an HTTP POST request made in node.js?How are parameters sent in an HTTP POST request?Trying to display all posts in my archive page but it is only returning the page content










0















I am involved in a web project under Wordpress and I need if you could help me with the following issue. In each one of the posts of the web there is an embedded video (usually from Youtube), through the following shortcode:



[video src="https://www.youtube.com/watch?v=ZYZxmYP7QOo"]


In the page where these post are shown, below the video, there are comments from the different users of the website, the title of the video, link to the social networks of author, etc ...).



Additionally, I created a page where the user who is logged on the web, can see the entire list of videos that he has uploaded. The question is now, when this page shows the user information, all the content of the post is shown too (including, p.e, comments). I would like that only the video and its title were shown (without comments or any other information). The code written up to now is the following one:



// tipo POSTS
$the_args['post_type']='post';
$the_query = new WP_Query($the_args);
?>
<?php if ($the_query-> have_posts ()) :?>
<h2>posts</h2>
<ul>
<?php while ($the_query-> have_posts ()) : $the_query-> the_post();
the_content();
php endwhile; ?>
</ul>
<?php endif; ?>


Question:



How can I filter the content()? I understand that it should be using the function add_filter (), but I do not get to know the specify code to do it.



Regards










share|improve this question
























  • Its very unclear what you're asking. Can you give specific details of what you are trying to do - for example, where are these comments etc coming from? Are you sure they in the post content, and are not just standard comments for example?

    – FluffyKitten
    Mar 7 at 21:20















0















I am involved in a web project under Wordpress and I need if you could help me with the following issue. In each one of the posts of the web there is an embedded video (usually from Youtube), through the following shortcode:



[video src="https://www.youtube.com/watch?v=ZYZxmYP7QOo"]


In the page where these post are shown, below the video, there are comments from the different users of the website, the title of the video, link to the social networks of author, etc ...).



Additionally, I created a page where the user who is logged on the web, can see the entire list of videos that he has uploaded. The question is now, when this page shows the user information, all the content of the post is shown too (including, p.e, comments). I would like that only the video and its title were shown (without comments or any other information). The code written up to now is the following one:



// tipo POSTS
$the_args['post_type']='post';
$the_query = new WP_Query($the_args);
?>
<?php if ($the_query-> have_posts ()) :?>
<h2>posts</h2>
<ul>
<?php while ($the_query-> have_posts ()) : $the_query-> the_post();
the_content();
php endwhile; ?>
</ul>
<?php endif; ?>


Question:



How can I filter the content()? I understand that it should be using the function add_filter (), but I do not get to know the specify code to do it.



Regards










share|improve this question
























  • Its very unclear what you're asking. Can you give specific details of what you are trying to do - for example, where are these comments etc coming from? Are you sure they in the post content, and are not just standard comments for example?

    – FluffyKitten
    Mar 7 at 21:20













0












0








0








I am involved in a web project under Wordpress and I need if you could help me with the following issue. In each one of the posts of the web there is an embedded video (usually from Youtube), through the following shortcode:



[video src="https://www.youtube.com/watch?v=ZYZxmYP7QOo"]


In the page where these post are shown, below the video, there are comments from the different users of the website, the title of the video, link to the social networks of author, etc ...).



Additionally, I created a page where the user who is logged on the web, can see the entire list of videos that he has uploaded. The question is now, when this page shows the user information, all the content of the post is shown too (including, p.e, comments). I would like that only the video and its title were shown (without comments or any other information). The code written up to now is the following one:



// tipo POSTS
$the_args['post_type']='post';
$the_query = new WP_Query($the_args);
?>
<?php if ($the_query-> have_posts ()) :?>
<h2>posts</h2>
<ul>
<?php while ($the_query-> have_posts ()) : $the_query-> the_post();
the_content();
php endwhile; ?>
</ul>
<?php endif; ?>


Question:



How can I filter the content()? I understand that it should be using the function add_filter (), but I do not get to know the specify code to do it.



Regards










share|improve this question
















I am involved in a web project under Wordpress and I need if you could help me with the following issue. In each one of the posts of the web there is an embedded video (usually from Youtube), through the following shortcode:



[video src="https://www.youtube.com/watch?v=ZYZxmYP7QOo"]


In the page where these post are shown, below the video, there are comments from the different users of the website, the title of the video, link to the social networks of author, etc ...).



Additionally, I created a page where the user who is logged on the web, can see the entire list of videos that he has uploaded. The question is now, when this page shows the user information, all the content of the post is shown too (including, p.e, comments). I would like that only the video and its title were shown (without comments or any other information). The code written up to now is the following one:



// tipo POSTS
$the_args['post_type']='post';
$the_query = new WP_Query($the_args);
?>
<?php if ($the_query-> have_posts ()) :?>
<h2>posts</h2>
<ul>
<?php while ($the_query-> have_posts ()) : $the_query-> the_post();
the_content();
php endwhile; ?>
</ul>
<?php endif; ?>


Question:



How can I filter the content()? I understand that it should be using the function add_filter (), but I do not get to know the specify code to do it.



Regards







wordpress post






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 20:01







fernanf

















asked Mar 7 at 19:53









fernanffernanf

196




196












  • Its very unclear what you're asking. Can you give specific details of what you are trying to do - for example, where are these comments etc coming from? Are you sure they in the post content, and are not just standard comments for example?

    – FluffyKitten
    Mar 7 at 21:20

















  • Its very unclear what you're asking. Can you give specific details of what you are trying to do - for example, where are these comments etc coming from? Are you sure they in the post content, and are not just standard comments for example?

    – FluffyKitten
    Mar 7 at 21:20
















Its very unclear what you're asking. Can you give specific details of what you are trying to do - for example, where are these comments etc coming from? Are you sure they in the post content, and are not just standard comments for example?

– FluffyKitten
Mar 7 at 21:20





Its very unclear what you're asking. Can you give specific details of what you are trying to do - for example, where are these comments etc coming from? Are you sure they in the post content, and are not just standard comments for example?

– FluffyKitten
Mar 7 at 21:20












1 Answer
1






active

oldest

votes


















0














Instead of using the shortcode, you can create a custom field for the video, then filter the output like below



 <?php while ($the_query-> have_posts ()) : $the_query-> the_post();
the_title();
the_field('video');
php endwhile; ?>





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051829%2ffiltering-post-content-wordpress%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Instead of using the shortcode, you can create a custom field for the video, then filter the output like below



     <?php while ($the_query-> have_posts ()) : $the_query-> the_post();
    the_title();
    the_field('video');
    php endwhile; ?>





    share|improve this answer



























      0














      Instead of using the shortcode, you can create a custom field for the video, then filter the output like below



       <?php while ($the_query-> have_posts ()) : $the_query-> the_post();
      the_title();
      the_field('video');
      php endwhile; ?>





      share|improve this answer

























        0












        0








        0







        Instead of using the shortcode, you can create a custom field for the video, then filter the output like below



         <?php while ($the_query-> have_posts ()) : $the_query-> the_post();
        the_title();
        the_field('video');
        php endwhile; ?>





        share|improve this answer













        Instead of using the shortcode, you can create a custom field for the video, then filter the output like below



         <?php while ($the_query-> have_posts ()) : $the_query-> the_post();
        the_title();
        the_field('video');
        php endwhile; ?>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 9 at 9:00









        decoder88decoder88

        33624




        33624





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051829%2ffiltering-post-content-wordpress%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко