Forum Replies Created
-
AuthorPosts
-
Robert
ParticipantHi Elvin,
I allready fixed it with the action (works as well), but im still curious: if I use an element hook, what should I select at the display rules location?
There is no option to select for a custom post type, or am i missing something?
Ticket can be closed, because it’s resolved! Thanks for the help (again!)Robert
ParticipantYessssss! I made it work with an action 🙂
here is the code:
add_action( ‘wpsp_after_title’, ‘dht_custom_abstract_link’ );
function dht_custom_abstract_link() {
$link = get_field(‘speaker_in_abstract’);
if( $link ):
$link_url = $link[‘url’];
$link_title = $link[‘title’];
$link_target = $link[‘target’] ? $link[‘target’] : ‘_self’;
?><div class=”speaker-info”>
<p>Speaker: </p>” target=”<?php echo esc_attr( $link_target ); ?>”><?php echo esc_html( $link_title ); ?>
</div>
<?php endif;
}Robert
ParticipantHi Elvin,
I think Tom sorted the problem out, so the forum is fine for now, thanks!
yes, i figured out so far that the wpsp_after_title wss the way to go, but as i’m learning php, i’m not quite sure how to implement it.
normally i would use the elements- hooks option, where i can set the hook, but I cannot set the display rules for the hook wpsp_after_title to be shownor should i implement this in another way?
Robert
ParticipantThe question:
After searching and tweaking, fiddling and trying, I decided to ask my question on the forum 🙂
I have 2 custom post types;
– Speaker
– Abstracts (something the speaker said)The abstracts are shown in a 3 column grid on the homepage.
My client asked if it’s possible to show the link to the speaker, under the title of the abstract. (as I would with a category or a tag).
Normally I would connect those via a category or a tag, but as these are both custom post types, it’s not possible (out of the box) to make a relation between these 2 post types.
In the ‘Abstract’ post, I made a custom field (link) with the Generatepress Elements/hooks, so I can select the url to the speaker, and show it on that particular ‘Abstract’ below the content.
Now, my question;
How can I show this same link (to the speaker of this abstract) under the title of the post type abstract?Examples:
On the 3 column grid of this homepage, https://www.digitalhumanitiestilburg.com/The way the abstract should look (title, category – we are not going to use images here, so text only and no cards or any fancy layout)
https://www.digitalhumanitiestilburg.com/speakers/I would like the same speaker-link as in: https://www.digitalhumanitiestilburg.com/abstracts/finding-the-human-in-the-dark-forest-perspectives-on-user-practices-outside-of-social-media-platforms/ (speaker is below the content, in the yellow box).
I have also tried to place this same code below via a custom hook in generatepress, but it didn’t work (I cannot select the appropriate place for it to be shown.)
The code I used for the custom link is this (and i’d like to ‘get’ the same link to show under the title of the abstracts):
<div class=”speaker-wrapper”>
<?php$link = get_field(‘speaker_in_abstract’);
if( $link ):
$link_url = $link[‘url’];
$link_title = $link[‘title’];
$link_target = $link[‘target’] ? $link[‘target’] : ‘_self’;
?><div class=”speaker-info”>
Speaker:
” target=”<?php echo esc_attr( $link_target ); ?>”><?php echo esc_html( $link_title ); ?>
</div><?php endif; ?>
</div>Hope you can help me out!
Thanks in advance!Robert
Participantok, i typed why because my post got rejected…. Too many words?
here goes:
After searching and tweaking, fiddling and trying, I decided to ask my question on the forum 🙂
I have 2 custom post types;
– Speaker
– Abstracts (something the speaker said)The abstracts are shown in a 3 column grid on the homepage.
My client asked if it’s possible to show the link to the speaker, under the title of the abstract. (as I would with a category or a tag).
Normally I would connect those via a category or a tag, but as these are both custom post types, it’s not possible (out of the box) to make a relation between these 2 post types.
In the ‘Abstract’ post, I made a custom field (link) with the Generatepress Elements/hooks, so I can select the url to the speaker, and show it on that particular abstract below the content.
Now, my question;
How can I show this same link (to the speaker of this abstract) under the title of the post type abstract?Examples:
On the 3 column grid of this homepage, https://www.digitalhumanitiestilburg.com/The way the abstract should look (title, category – we are not going to use images here, so text only and no cards or any fancy layout)
https://www.digitalhumanitiestilburg.com/speakers/I would like the same speaker-link as in: https://www.digitalhumanitiestilburg.com/abstracts/finding-the-human-in-the-dark-forest-perspectives-on-user-practices-outside-of-social-media-platforms/ (speaker is below the content, in the yellow box).
I have also tried to place this same code below via a custom hook, but it didn’t work (maybe I missed an important step or messed up the custom hook- which I found somewhere on the forum wpsp_below_title or something like that)
The code I used for the custom link is this (and i’d like to ‘get’ the same link to show under the title of the abstracts):
<div class=”speaker-wrapper”>
<?php$link = get_field(‘speaker_in_abstract’);
if( $link ):
$link_url = $link[‘url’];
$link_title = $link[‘title’];
$link_target = $link[‘target’] ? $link[‘target’] : ‘_self’;
?><div class=”speaker-info”>
Speaker:
” target=”<?php echo esc_attr( $link_target ); ?>”><?php echo esc_html( $link_title ); ?>
</div><?php endif; ?>
</div>Hope you can help me out!
Thanks in advance!Robert
ParticipantHi tom, just saw your email in my mailbox (i’m the same guy 😉
Thanks for responding. i will try again, and will let you know if it happens again.
Cheers!Robert
Participantcant submit anything which is more then just a single line of tekst….
is there a restriction on how many words a post can have?Robert
Participantok, i typed ‘why’ because my post got rejected…. Too many words?
-
AuthorPosts