google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

Do shortcode doesn´t work #466

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi There!

I need to add a shortcode inside my "entry" div, I did added the shortcode, but 
it dosen´t work. I think that there might be something about the path, since I 
noticed that all the other elemens are using this "($page->ID)", so what should 
the shortcode sintaxis be?

<div class="demobox" id="demo-5">       
  <a href="<?php echo get_page_link($page->ID) ?>">
     <?php                                                 $imagenAlternativa = get_post_meta($page->ID, 'imagenalternativa', true); 
                                                echo(wp_get_attachment_image($imagenAlternativa, 'full'));
?></a>
     <div class="details">
        <?php echo $page->post_excerpt ?>
     </div>
    </div>

    <h4><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h4>                                          
     <div class="entry"><?php print_custom_field('detalles:do_shortcode'); ?>
 </div>
     <p><a href="<?php echo get_page_link($page->ID) ?>">Ver m&aacute;s</a></p>
 </div>

Original issue reported on code.google.com by soppe...@gmail.com on 11 Mar 2013 at 8:47

GoogleCodeExporter commented 9 years ago
Please include all the relevant data about your server and the version of CCTM. 
 See item #1 here: 
https://code.google.com/p/wordpress-custom-content-type-manager/wiki/Invalid

I have had trouble with the do_shortcode output filter.  You can use WP's 
native function to see if you get any different results.

Are you using the sample templates that the CCTM provides for you (see CCTM -> 
Content Types --> View Sample Templates)?  Just curious.  

Original comment by ever...@fireproofsocks.com on 11 Mar 2013 at 9:07

GoogleCodeExporter commented 9 years ago
Oh! Ok, here´s the plugin info:
Plugin Version: 0.9.6.7-pl
WordPress Version: 3.4
PHP Version: 5.3.19
MySQL Version: 5.1.63-community
Server OS: WINNT

Yes, I´m using the exact sample template code. I´m new to php and wordpress, 
so do you know about an example for calling a WP native function that could 
match this problem? I would be so so so thankful!

Original comment by soppe...@gmail.com on 11 Mar 2013 at 9:14

GoogleCodeExporter commented 9 years ago
Would something like this work? 
 <?php 
                                               $imagenAlternativa = get_post_meta($page->ID, 'imagenalternativa', true); 
                                                echo(wp_get_attachment_image($imagenAlternativa, 'full'));
                                            ?>

But it´s not an image, it´s a text. 'imagenalternativa' is another custom 
field that I created, and this worked, but I don´t know how to adapt it to my 
'detalles' new custom field.

Original comment by soppe...@gmail.com on 11 Mar 2013 at 9:32

GoogleCodeExporter commented 9 years ago
I´ve tried this also (note that "details" is the custom field I need to show):
<?php echo get_post_meta($page->ID, 'detalles', true); ?>

Original comment by soppe...@gmail.com on 11 Mar 2013 at 9:55

GoogleCodeExporter commented 9 years ago
Please update to the latest version: 0.9.7.  

Re your question.... wp_get_attachment_image() operates on a post ID, so if you 
have an image field, you could just do:

<?php print_custom_field('my_image:to_image_tag'); ?>

Original comment by ever...@fireproofsocks.com on 11 Mar 2013 at 10:04

GoogleCodeExporter commented 9 years ago
oh, no no , I was suggesting to use that function, but what I need is for a 
Wysiwyg custom type, I just thought that maybe we could adapt that function. 
But still no luck.. :( 

Original comment by soppe...@gmail.com on 11 Mar 2013 at 10:08

GoogleCodeExporter commented 9 years ago
Sorry I don't follow you.  WYSIWYG fields are only displayed inside the WP 
manager - are you wanting to display a form on the public part of your site?  

Once you've upgraded to the current release of the plugin if the do_shortcode 
output filter is still causing a problem, then I will look at this as a valid 
bug report.  For now, you can use WP's do_shortcode function 
http://codex.wordpress.org/Function_Reference/do_shortcode

Original comment by ever...@fireproofsocks.com on 11 Mar 2013 at 10:12

GoogleCodeExporter commented 9 years ago

Original comment by ever...@fireproofsocks.com on 14 May 2013 at 8:25