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»</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."