How to apply excerpt inside my XML data on WordPressHow does one parse XML files?How can I build XML in C#?How to Deserialize XML documentHow do I escape ampersands in XML so they are rendered as entities in HTML?How do I parse XML in Python?How do I comment out a block of tags in XML?How to add a PHP page to WordPress?How do you parse and process HTML/XML in PHP?How To Auto-Format / Indent XML/HTML in Notepad++How to pretty print XML from the command line?

Why aren't rainbows blurred-out into nothing after they are produced?

Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?

Why are Gatwick's runways too close together?

How to reduce Sinas Chinam

Simplification of numbers

A continuous water "planet" ring around a star

What should I call bands of armed men in the Middle Ages?

How are you supposed to know the strumming pattern for a song from the "chord sheet music"?

How to assign many blockers at the same time?

What is the status of the F-1B engine development?

Word for an event that will likely never happen again

Can a PC use the Levitate spell to avoid movement speed reduction from exhaustion?

Heat equation: Squiggly lines

The cat ate your input again!

Redis Cache Shared Session Configuration

Why is there a large performance impact when looping over an array over 240 elements?

Why does the standard fingering / strumming for a D maj chord leave out the 5th string?

Annotating a table with arrows

Why did Gandalf use a sword against the Balrog?

Does the Fireball spell damage objects?

Are differences between uniformly distributed numbers uniformly distributed?

Is it feasible to get a hash collision for CRC32, MD-5 and SHA-1 on one file?

Are employers legally allowed to pay employees in goods and services equal to or greater than the minimum wage?

How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?



How to apply excerpt inside my XML data on WordPress


How does one parse XML files?How can I build XML in C#?How to Deserialize XML documentHow do I escape ampersands in XML so they are rendered as entities in HTML?How do I parse XML in Python?How do I comment out a block of tags in XML?How to add a PHP page to WordPress?How do you parse and process HTML/XML in PHP?How To Auto-Format / Indent XML/HTML in Notepad++How to pretty print XML from the command line?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm pulling out the data from my CRM to my WordPress site using a XML.
It worked actually, but I want to add some functions like read more with the my XML data Web_Remarks[1] it contains a long description.



Then I tried to add conditions from from my function.php
like excerpt and edit my descriptions code.



For my functions.php I add



<?php
// Customize excerpt for description word count length
function custom_excerpt_length()
return 25;


add_filter('excerpt_length','custom_excerpt_length');

?>



And for my description.php I change my <?php the_content();?> to



<?php if ($post->post_excerpt) ?>
<p>
<?php echo get_the_excerpt(); ?>
<a href="<?php the_permalink();?>">Read More&raquo;</a>
</p>
<?php else
the_content();

?>


I expect the output should be "3Bed room with laundry ro..Read More..."



but what I have now is



"3Bed room with laundry room and sea view with 2 car parkings only for 3.06M!
-Bright
-Spacious
-Sea/Palm view
-Balconies
-Higher floor
-No Construction chance infront
-Prime location
real estate are a Property Investment Firm with an ownership of more than 2500 properties all around the world.These are handpicked exclusive apartments and villas, located within the most prestigious and high-profile developments of Dubai. We do not just believe in customer satisfaction, we aim for customer delight. We understand that our customers define the standard of quality and service and your loyalty must be earned."










share|improve this question






























    0















    I'm pulling out the data from my CRM to my WordPress site using a XML.
    It worked actually, but I want to add some functions like read more with the my XML data Web_Remarks[1] it contains a long description.



    Then I tried to add conditions from from my function.php
    like excerpt and edit my descriptions code.



    For my functions.php I add



    <?php
    // Customize excerpt for description word count length
    function custom_excerpt_length()
    return 25;


    add_filter('excerpt_length','custom_excerpt_length');

    ?>



    And for my description.php I change my <?php the_content();?> to



    <?php if ($post->post_excerpt) ?>
    <p>
    <?php echo get_the_excerpt(); ?>
    <a href="<?php the_permalink();?>">Read More&raquo;</a>
    </p>
    <?php else
    the_content();

    ?>


    I expect the output should be "3Bed room with laundry ro..Read More..."



    but what I have now is



    "3Bed room with laundry room and sea view with 2 car parkings only for 3.06M!
    -Bright
    -Spacious
    -Sea/Palm view
    -Balconies
    -Higher floor
    -No Construction chance infront
    -Prime location
    real estate are a Property Investment Firm with an ownership of more than 2500 properties all around the world.These are handpicked exclusive apartments and villas, located within the most prestigious and high-profile developments of Dubai. We do not just believe in customer satisfaction, we aim for customer delight. We understand that our customers define the standard of quality and service and your loyalty must be earned."










    share|improve this question


























      0












      0








      0


      1






      I'm pulling out the data from my CRM to my WordPress site using a XML.
      It worked actually, but I want to add some functions like read more with the my XML data Web_Remarks[1] it contains a long description.



      Then I tried to add conditions from from my function.php
      like excerpt and edit my descriptions code.



      For my functions.php I add



      <?php
      // Customize excerpt for description word count length
      function custom_excerpt_length()
      return 25;


      add_filter('excerpt_length','custom_excerpt_length');

      ?>



      And for my description.php I change my <?php the_content();?> to



      <?php if ($post->post_excerpt) ?>
      <p>
      <?php echo get_the_excerpt(); ?>
      <a href="<?php the_permalink();?>">Read More&raquo;</a>
      </p>
      <?php else
      the_content();

      ?>


      I expect the output should be "3Bed room with laundry ro..Read More..."



      but what I have now is



      "3Bed room with laundry room and sea view with 2 car parkings only for 3.06M!
      -Bright
      -Spacious
      -Sea/Palm view
      -Balconies
      -Higher floor
      -No Construction chance infront
      -Prime location
      real estate are a Property Investment Firm with an ownership of more than 2500 properties all around the world.These are handpicked exclusive apartments and villas, located within the most prestigious and high-profile developments of Dubai. We do not just believe in customer satisfaction, we aim for customer delight. We understand that our customers define the standard of quality and service and your loyalty must be earned."










      share|improve this question














      I'm pulling out the data from my CRM to my WordPress site using a XML.
      It worked actually, but I want to add some functions like read more with the my XML data Web_Remarks[1] it contains a long description.



      Then I tried to add conditions from from my function.php
      like excerpt and edit my descriptions code.



      For my functions.php I add



      <?php
      // Customize excerpt for description word count length
      function custom_excerpt_length()
      return 25;


      add_filter('excerpt_length','custom_excerpt_length');

      ?>



      And for my description.php I change my <?php the_content();?> to



      <?php if ($post->post_excerpt) ?>
      <p>
      <?php echo get_the_excerpt(); ?>
      <a href="<?php the_permalink();?>">Read More&raquo;</a>
      </p>
      <?php else
      the_content();

      ?>


      I expect the output should be "3Bed room with laundry ro..Read More..."



      but what I have now is



      "3Bed room with laundry room and sea view with 2 car parkings only for 3.06M!
      -Bright
      -Spacious
      -Sea/Palm view
      -Balconies
      -Higher floor
      -No Construction chance infront
      -Prime location
      real estate are a Property Investment Firm with an ownership of more than 2500 properties all around the world.These are handpicked exclusive apartments and villas, located within the most prestigious and high-profile developments of Dubai. We do not just believe in customer satisfaction, we aim for customer delight. We understand that our customers define the standard of quality and service and your loyalty must be earned."







      php xml wordpress






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 8:49









      Carlvic Japitana LimCarlvic Japitana Lim

      611 silver badge13 bronze badges




      611 silver badge13 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0














          Try,



          <?php
          $excerpt = get_the_excerpt();
          if( !empty($excerpt) ) ?>
          <p>
          <?php echo $excerpt; ?>
          <a href="<?php the_permalink();?>">Read More&raquo;</a>
          </p>
          <?php
          else
          the_content();



          Or this will be a another method you can use:



          <?php
          // Add this code in functions.php file
          function wp_get_custom_excerpt( $limit = '25' )
          global $post;

          $content = get_the_excerpt();
          if( empty($content) )
          $content = strip_shortcodes( $post->post_content );


          $excerpt = wp_trim_words( $content, $limit, '[...]' );
          return $excerpt;


          // Remove your excerpt code and just echo function.
          echo wp_get_custom_excerpt();





          share|improve this answer



























          • Same nothing happen, It didn't limit my words.

            – Carlvic Japitana Lim
            Mar 27 at 10:21











          • @CarlvicJapitanaLim check answer updated.

            – Jaydip Nimavat
            Mar 27 at 10:27











          • now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

            – Carlvic Japitana Lim
            Mar 27 at 10:44











          • You have to use the_content() for full content. this function can be used to get the excerpt only.

            – Jaydip Nimavat
            Mar 27 at 11:15










          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%2f55373057%2fhow-to-apply-excerpt-inside-my-xml-data-on-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














          Try,



          <?php
          $excerpt = get_the_excerpt();
          if( !empty($excerpt) ) ?>
          <p>
          <?php echo $excerpt; ?>
          <a href="<?php the_permalink();?>">Read More&raquo;</a>
          </p>
          <?php
          else
          the_content();



          Or this will be a another method you can use:



          <?php
          // Add this code in functions.php file
          function wp_get_custom_excerpt( $limit = '25' )
          global $post;

          $content = get_the_excerpt();
          if( empty($content) )
          $content = strip_shortcodes( $post->post_content );


          $excerpt = wp_trim_words( $content, $limit, '[...]' );
          return $excerpt;


          // Remove your excerpt code and just echo function.
          echo wp_get_custom_excerpt();





          share|improve this answer



























          • Same nothing happen, It didn't limit my words.

            – Carlvic Japitana Lim
            Mar 27 at 10:21











          • @CarlvicJapitanaLim check answer updated.

            – Jaydip Nimavat
            Mar 27 at 10:27











          • now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

            – Carlvic Japitana Lim
            Mar 27 at 10:44











          • You have to use the_content() for full content. this function can be used to get the excerpt only.

            – Jaydip Nimavat
            Mar 27 at 11:15















          0














          Try,



          <?php
          $excerpt = get_the_excerpt();
          if( !empty($excerpt) ) ?>
          <p>
          <?php echo $excerpt; ?>
          <a href="<?php the_permalink();?>">Read More&raquo;</a>
          </p>
          <?php
          else
          the_content();



          Or this will be a another method you can use:



          <?php
          // Add this code in functions.php file
          function wp_get_custom_excerpt( $limit = '25' )
          global $post;

          $content = get_the_excerpt();
          if( empty($content) )
          $content = strip_shortcodes( $post->post_content );


          $excerpt = wp_trim_words( $content, $limit, '[...]' );
          return $excerpt;


          // Remove your excerpt code and just echo function.
          echo wp_get_custom_excerpt();





          share|improve this answer



























          • Same nothing happen, It didn't limit my words.

            – Carlvic Japitana Lim
            Mar 27 at 10:21











          • @CarlvicJapitanaLim check answer updated.

            – Jaydip Nimavat
            Mar 27 at 10:27











          • now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

            – Carlvic Japitana Lim
            Mar 27 at 10:44











          • You have to use the_content() for full content. this function can be used to get the excerpt only.

            – Jaydip Nimavat
            Mar 27 at 11:15













          0












          0








          0







          Try,



          <?php
          $excerpt = get_the_excerpt();
          if( !empty($excerpt) ) ?>
          <p>
          <?php echo $excerpt; ?>
          <a href="<?php the_permalink();?>">Read More&raquo;</a>
          </p>
          <?php
          else
          the_content();



          Or this will be a another method you can use:



          <?php
          // Add this code in functions.php file
          function wp_get_custom_excerpt( $limit = '25' )
          global $post;

          $content = get_the_excerpt();
          if( empty($content) )
          $content = strip_shortcodes( $post->post_content );


          $excerpt = wp_trim_words( $content, $limit, '[...]' );
          return $excerpt;


          // Remove your excerpt code and just echo function.
          echo wp_get_custom_excerpt();





          share|improve this answer















          Try,



          <?php
          $excerpt = get_the_excerpt();
          if( !empty($excerpt) ) ?>
          <p>
          <?php echo $excerpt; ?>
          <a href="<?php the_permalink();?>">Read More&raquo;</a>
          </p>
          <?php
          else
          the_content();



          Or this will be a another method you can use:



          <?php
          // Add this code in functions.php file
          function wp_get_custom_excerpt( $limit = '25' )
          global $post;

          $content = get_the_excerpt();
          if( empty($content) )
          $content = strip_shortcodes( $post->post_content );


          $excerpt = wp_trim_words( $content, $limit, '[...]' );
          return $excerpt;


          // Remove your excerpt code and just echo function.
          echo wp_get_custom_excerpt();






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 27 at 10:27

























          answered Mar 27 at 9:51









          Jaydip NimavatJaydip Nimavat

          3714 silver badges18 bronze badges




          3714 silver badges18 bronze badges















          • Same nothing happen, It didn't limit my words.

            – Carlvic Japitana Lim
            Mar 27 at 10:21











          • @CarlvicJapitanaLim check answer updated.

            – Jaydip Nimavat
            Mar 27 at 10:27











          • now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

            – Carlvic Japitana Lim
            Mar 27 at 10:44











          • You have to use the_content() for full content. this function can be used to get the excerpt only.

            – Jaydip Nimavat
            Mar 27 at 11:15

















          • Same nothing happen, It didn't limit my words.

            – Carlvic Japitana Lim
            Mar 27 at 10:21











          • @CarlvicJapitanaLim check answer updated.

            – Jaydip Nimavat
            Mar 27 at 10:27











          • now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

            – Carlvic Japitana Lim
            Mar 27 at 10:44











          • You have to use the_content() for full content. this function can be used to get the excerpt only.

            – Jaydip Nimavat
            Mar 27 at 11:15
















          Same nothing happen, It didn't limit my words.

          – Carlvic Japitana Lim
          Mar 27 at 10:21





          Same nothing happen, It didn't limit my words.

          – Carlvic Japitana Lim
          Mar 27 at 10:21













          @CarlvicJapitanaLim check answer updated.

          – Jaydip Nimavat
          Mar 27 at 10:27





          @CarlvicJapitanaLim check answer updated.

          – Jaydip Nimavat
          Mar 27 at 10:27













          now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

          – Carlvic Japitana Lim
          Mar 27 at 10:44





          now the limit is working but when i click read more the whole text description didn't show. I just refresh my page

          – Carlvic Japitana Lim
          Mar 27 at 10:44













          You have to use the_content() for full content. this function can be used to get the excerpt only.

          – Jaydip Nimavat
          Mar 27 at 11:15





          You have to use the_content() for full content. this function can be used to get the excerpt only.

          – Jaydip Nimavat
          Mar 27 at 11:15








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          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%2f55373057%2fhow-to-apply-excerpt-inside-my-xml-data-on-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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현