Regarding the image, I am trying to display the website name and have it link to the website url, but am not sure how to do that. I tried doing:
<p><a href="<em><u>hidden link</u></em>;?php echo(types_render_field( "website-url", array( ) )); ?>"><?php echo(types_render_field( "website-name", array( ) )); ?></a></p>
Dear Vytenisk,
As far as I can see that code should work. Maybe you need to remove the http:// like this:
<p><a href="<?php echo(types_render_field( "website-url", array( ) )); ?>"><?php echo(types_render_field( "website-name", array( ) )); ?></a></p>
What is the result you are getting? Can you enable WP_DEBUG to see if you have error messages?
https://toolset.com/documentation/user-guides/debugging-types-and-views/
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
Dear VytenisK,
Its important to insert the code in the right context. In other words, if there is a php tag opened before the code, make sure its closed after. Can you show me a couple of lines before your code aswell to make sure? Also enable WP_DEBUG because it may give us some clues about what is happening.
https://toolset.com/documentation/user-guides/debugging-types-and-views/
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
I'm on the page in question but console doesn't seem to flag any errors. Here is my code:
<div class="summary entry-summary">
<h2>ABOUT THE SHOOT</h2>
<div class="about-shoot">
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
do_action( 'woocommerce_single_product_summary' ); /* DESCRIPTION */
?>
</div>
<div class="more-info">
<h3>MORE INFO</h3>
<p>» <p><a href="<?php echo(types_render_field( "website-url", array( ) )); ?>"><?php echo(types_render_field( "website-name", array( ) )); ?></a></p>
<p>« Photos by </p>
</div>
</div><!-- .summary -->
Dear VytenisK,
I cant see anything wrong with that code. Can you provide the URL to check if its a CSS issue or something? I would also like to check the source code generated.
Thanks,
Caridad
This is now what my HTML says:
<p>» <?php echo(types_render_field( "website-url", array("title"=>"") )); ?><?php echo(types_render_field( "website-name", array( ) )); ?></p>
And what my source reads:
<p>» <a href="www.vytweb.com" title="www.vytweb.com">www.vytweb.com</a>My Portfolio</p>
Ok, I understand now. When you render a URL field it is being rendered with the link and everything. You need to use the raw parameter to get only the URL like you need:
<p>" <a href="<em><u>hidden link</u></em>;?php echo(types_render_field( "website-url", array("raw"=>"true") )); ?>"><?php echo(types_render_field( "website-name", array( ) )); ?></a></p>
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
Awesome, that works! Thank you very much for helping me out. Could you explain in layman's terms exactly what raw = true does?
It displays the value of the field as it is stored in the database, with no formatting applied.
https://toolset.com/documentation/functions/#URL
Regards,
Caridad