jmuller777
Forum Replies Created
-
Forum: Plugins
In reply to: [Social Count Plus] Get the usernames / IDs used in the pluginThanks a lot!
Forum: Plugins
In reply to: [Social Count Plus] Get the usernames / IDs used in the pluginI am sorry, but i am not really what you could call a tech guy.
I dont understand very well how to use your methods, so could you please clarify a little further?
Lets say i have a template and want to get get the twitter counter and the username (to build the twitter link). The first part is easy, i use the “<?php echo get_scp_twitter(); ?>” – But i have no idea on how to get the second part.
For instance:
<p>We have <stong><?php echo get_scp_twitter(); ?></strong> followers on twitter.</p> Click <a href="https://twitter.com/<?php ??????????? ?>">here</a> to find us on twitter!
What should i use in the place of: “<?php ??????????? ?>”?
Forum: Plugins
In reply to: [Social Count Plus] Get the usernames / IDs used in the pluginSorry, but i dont know what you mean when you simply say: “Just follow your methods” and point me to that code.
Could you please elaborate a little more?
Works great now, that last version solved it perfectly!
I just figured out that this function is not working on pages. It works on custom pages and posts, but not on the standard wordpress pages.
I have the code below on my function.php:
<?php add_filter('wp_postratings_schema_itemtype', 'wp_postratings_schema_itemtype'); function wp_postratings_schema_itemtype($itemtype) { return 'itemscope itemtype="https://schema.org/AggregateRating"'; } ?>
But on pages the output is not appearing with the the AggregateRating markup, it is displaying like this:
<div id="post-ratings-479" class="post-ratings">... ...stuff ... ...</div>
Could you please help me out on how to get the right markup on pages as well?
Thanks!
They said on their side everything is ok,
They also got rid of those errors, but now i get no errors nor any type of output as a result of the relationship field.
I am trying to use this code:
<?php //*Adds book's fields add_action( 'genesis_before_entry_content', 'do_book_fields' ); function do_book_fields() { //get Pods object for current post $pod = pods( 'book', get_the_id() ); $book_image = $pod->display( 'book_image' ); //*adds the book image if its setted if ($book_image) {?> <dl><dt>Image:</dt> <dd><a href="<?php echo get_permalink( $post->ID ); ?>" title="<?php the_title(); ?>"><img src="<?php echo $book_image ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /></a></dd></dl> <?php //get author post title as link //get the value for the relationship field $related = $pod->field( 'book_author' ); //loop through related field, creating links to their own pages //only if there is anything to loop through if ( ! empty( $related ) ) { foreach ( $related as $rel ) { //get id for related post and put in ID //for advanced content types use $id = $rel[ 'id' ]; $id = $rel[ 'ID' ]; //show the related post name as link echo '<a href="'.get_permalink($id).'">'.get_the_title( $id ).'</a>'; } //end of foreach } //endif ! empty ( $related ) var_dump( get_the_id() ); $pod = pods( 'book', get_the_id() ); var_Dump( $pod->id() ); }} genesis();
The custom field assigned to the book image is working properly, as you can see here:https://fuvestibular.com.br/book/book-test/ but theres no output for the related post type author.
I putted the The var_Dump just to see what it shows, and it is this: int(3216) int(3216)
At least theres no erros anymore….
Any thought on this?
An here is the wordpress install i have in hostgator, where the code works perfectly:
WordPress Version: 3.9.1 PHP Version: 5.2.17 MySQL Version: 5.5.33 Server Software: Apache Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 Session Save Path: /tmp Session Save Path Exists: Yes Session Save Path Writeable: Yes Session Max Lifetime: 1440 WPDB Prefix: wp_ WP Multisite Mode: No WP Memory Limit: 40M Pods Network-Wide Activated: No Pods Install Location: /home1/denrrou/public_html/denrrou.com.br/wp-content/plugins/pods/ Pods Tableless Mode Activated: No Pods Light Mode Activated: No Currently Active Theme: Lifestyle Pro Theme
Email me: [email protected]
and if you want, i can give you access to both environments.
Thanks for your patience.
Sorry, but i dont have a gist account.
Here is the synthesis environment where the error is occurring:
WordPress Version: 3.9.1 PHP Version: 5.3.10-1ubuntu3.11 MySQL Version: 5.5.37 Server Software: Apache/2.2.22 (Ubuntu) Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 Session Save Path: /var/lib/php5 Session Save Path Exists: Yes Session Save Path Writeable: Yes Session Max Lifetime: 1440\ WPDB Prefix: wp_ WP Multisite Mode: No WP Memory Limit: 40M Pods Network-Wide Activated: No Pods Install Location: /var/www/fuvestibular.com.br/wp-content/plugins/pods/ Pods Tableless Mode Activated: No Pods Light Mode Activated: No Currently Active Theme: Fuvestibular
I got this as an answer:
You will want to verify that the code does not require the exec() / exec.php or url_fopen functions, as both of those have been disabled on Synthesis hosting for security reasons.
We do support CURL as an alternative to url_fopen.
Could you confirm if that is the case with the code i am trying to use?
well, dont mind…
I decided to test it out on another host and and the stuff worked out like magic.
The problem seems to be with synthesis managed host, already sent a ticket and now i am just waiting.
I will report back when i hear from them.
No success… =(
I really want to use this plugin. I am migrating from wp-types to pods because it has more capabilities and seems to be much better, but it is also more technical…
With types i was able to get it by simply using this:
$cptb_parent_id = wpcf_pr_post_get_belongs(get_the_ID(),'escritores'); $author_name = get_the_title($cptb_parent_id); $author_url = post_permalink($cptb_parent_id);
I already learned how to do all the other stuff with pods and i just need to get it working now, but this topic is seeming something beyond my powers.
I know its a little to much to ask, but if i give you my credentials: would you check this out for me?
I would be grateful for the rest of my life!
Theres a message:
NOTICE: wp-content/themes/fuvestibular/single-livro.php:12 – Uninitialized string offset: 0
The line 12 insite that custom post template is
$id = $rel[ 'ID' ];
Should be something wrong with it?
I just created the “livro” custom post type with pods and also created a file name single-livro.php inside my theme folder.
The template file is working properly with this pod since the stuff i place inside it reflects on the “livro” post type output. I could display the post custom fields with no problem.
I dont know why the single-livro.php appeared on the debug message. This post type uses single-livro.php, thats where i just pasted the code from the tutorial replacing my pods name and the relationship field it uses and that is related to the custom post i want to get the title and url.
Also replaced the line you mentioned but with no success.
Well, i am not a php guy and all i can do is thought trial and error…
Nevertheless, i removed the var_dump from the CPT template and tried to follow your instructions. I got the result you can see in this picture : https://fuvestibular.com.br/wp-content/uploads/2014/06/Screen-Shot-2014-06-09-at-6.33.29-PM.png
I am with debug mode enabled right now, and a new strange message with links appeared it that page: https://fuvestibular.com.br/livro/sentimento-mundo/ maybe if you can take a look you might understand something…
This is the pod livro custom type and i have single-livro.php inside my theme folder, the code of this file is exactly this right now:
<?php //get Pods object for current post $pod = pods( 'livro', get_the_id() ); //get the value for the relationship field $related = $pod->field( 'autor_do_livro' ); //loop through related field, creating links to their own pages //only if there is anything to loop through if ( ! empty( $related ) ) { foreach ( $related as $rel ) { //get id for related post and put in ID //for advanced content types use $id = $rel[ 'id' ]; $id = $rel[ 'ID' ]; //show the related post name as link echo '<a href="'.get_permalink($id).'">'.get_the_title( $id ).'</a>'; //get the value for some_field in related post and echo it $someField = get_post_meta( $id, 'imagem_do_livro', true ); echo $someField; } //end of foreach } //endif ! empty ( $related ) genesis(); ?>
I put the var dump back again,
This is the code of single-livro.php which generates this page: https://fuvestibular.com.br/livro/sentimento-mundo/
<?php //get Pods object for current post $pod = pods( 'livro', get_the_id() ); //get the value for the relationship field $related = $pod->field( 'autor_do_livro' ); //loop through related field, creating links to their own pages //only if there is anything to loop through if ( ! empty( $related ) ) { foreach ( $related as $rel ) { //get id for related post and put in ID //for advanced content types use $id = $rel[ 'id' ]; $id = $rel[ 'ID' ]; //show the related post name as link echo '<a href="'.get_permalink($id).'">'.get_the_title( $id ).'</a>'; //get the value for some_field in related post and echo it $someField = get_post_meta( $id, 'imagem_do_livro', true ); echo $someField; } //end of foreach } //endif ! empty ( $related ) $a = $related; var_dump ($a); genesis(); ?>
The page title of the related author page (Escritor Teste) and the other stuff looks ok in the responses, but as you can see, the code is generating unexpected links at the top of the page.
I have no clue about whats going on, your help is more than appreciated!