happik
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: assign post format to single.php without get_template_partThank you all for all the information. Now it will take some time to check and debug it ??
Forum: Developing with WordPress
In reply to: assign post format to single.php without get_template_partSo if I understand well – the function
get_post_format()
should return the string standard or aside or gallery or link based on the chosen format of the post?So this code should work:
if ( 'gallery' == get_post_format() ) { <article class="post post-gallery"> <h2><?php the_title(); ?></h2> <?php the_content(); ?> </article> } elseif ( 'aside' == get_post_format() ) { <article class="post post-aside"> <p class="mini-meta"><?php the_author();?> @ <?php the_time('j. n. Y G:i')?></p> <?php the_content(); ?> </article> } } elseif ( 'link' == get_post_format() ) { <article class="post post-link"> <p class="mini-meta"><?php the_author();?> @ <?php the_time('j. n. Y G:i')?></p> <a href="<?php echo get_the_content(); ?>"><?php the_title(); ?></a> </article> } else { ... }
and then I should only set the CSS of the classes post-link, post-aside, post-gallery.
Forum: Developing with WordPress
In reply to: assign post format to single.php without get_template_partI have created the file content.php that contains now:
<article class="post <?php if (has_post_thumbnail() ) { ?>has-thumbnail <?php } ?>"> <!-- post-thumbnail --> <div class="post-thumbnail"> <?php if (is_single() ) {?> <?php the_post_thumbnail('banner-image'); } else {?> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('small-thumbnail'); }?></a> </div><!-- /post-thumbnail --> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p class="post-info"><?php the_time('j. n. Y G:i'); ?> | od <a href="<?php get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author()?></a> | Publikováno v <?php $categories = get_the_category(); $separator = ", "; $output = ''; if($categories) { foreach ($categories as $category) { $output .= '<a href=" ' . get_category_link($category->term_id) . ' ">' . $category->cat_name . '</a>' . $separator; } echo trim($output, $separator); } ?> </p> <?php if (is_single() ) { the_content(); } elseif ( is_search() OR is_archive() ) {?> <p> <?php echo get_the_excerpt(); ?> <a href="<?php the_permalink(); ?>">?íst dál»</a> </p> <?php } else { if ($post->post_excerpt) { ?> <p> <?php echo get_the_excerpt(); ?> <a href="<?php the_permalink(); ?>">?íst dál»</a> </p> <?php } else { the_content(); } } ?> </article>
and I would like to remove the undesirable if-conditions
is_single()
in the content.php. I would like to create specific file single.php that will correspond the format of the post chosen in the WordPress backend.Unfortunately I can’t do it now because I don’t know the suitable code in single.php to respect the type of the post.
If I write the line
get_template_part('content', get_post_format())
to the single file then the conditionis_single()
will be called automatically “in the single.php” (I know that I am in single file so it is easier write there the code to respect the format directly).Forum: Developing with WordPress
In reply to: assign post format to single.php without get_template_partOk, so my php-pages are content-aside.php, content-gallery.php, content-link.php. They work perfectly in index.php, search.php, archive.php (I use the code
get_template_part('content', get_post_format())
there).What logic should I write to the single.php to force to use the content-gallery.php with corresponding CSS styles in case I choose the gallery post format?
Thank you.
Ok, thank you. I will choose ignore.
Dear all.
1) Should the reinstall of the plugin solve the problem?
2) How to reinstall the plugin without loosing the settings of the plugin? I have there an application password to google account and I would like to preserve the settings.
Dear @wfyann.
Do you think that the ptotection that I have now is sufficient to not being hacked? Should I consider to install additional firewall protection unless the provider allows me to change the value? Vhich protection is suitable for me now?
Thank you for your time.
Dear @wfyann,
I have just received an explanation from support.
They can’t change the “prepend_file” setting because it is already set within php.ini. It is used for server variables.They didn’t received any other requests of this kind from anyone else but they will take it into account in next update.
Do we have any other possibility?
Thank you, Karel
- This reply was modified 7 years, 9 months ago by happik.
Forum: Developing with WordPress
In reply to: the_excerpt() not workingHi all.
Thank you all for your contribution to this thread. You all have helped me to find the solution.
It is not a good idea to write the
get_excerpt()
to the fileindex.php
without any rules and without the filesingle.php
.If there is no
single.php
(and I do not have it) then there isn’t the way to show the whole content.It would work with the combination of
single.php
withget_content()
inside, but the best way for me is to use is_single() inindex.php
.It’s working now! Thank you.
- This reply was modified 7 years, 9 months ago by happik.
Hi @wfyann,
I have contacted the support and send them the information. They do not understand exactly what does it mean. Could you please be more specific?
They have asked me:
“The application talks for example about an auto_prepend_file directive. Do you try to set this one or any other one?”Thank you.
- This reply was modified 7 years, 9 months ago by happik.
Forum: Developing with WordPress
In reply to: the_excerpt() not workingHi all,
@alchymyth: I have called all posts in the loop in the index file. I didn’t create a post template by myself yet. I have added another file archive.php with the same content as index. Could this be the problem?
@t-p: I am working on my own theme, that’s why I write to the developing group. There is nothing special except the loop and added other infos. I hope somebody have experience to help me.
Hi @wfyann.
I have just send you the diagnostics report. If you agree we can manage a skype call. I can share my desktop and we can find the solution.
Thank you.
Hi @wfyann.
The Protection level is showing Basic WordPress Protection.
There is still information:
To make your site as secure as possible, take a moment to optimize the Wordfence Web Application Firewall: Click here to configure. Dismiss
If you cannot complete the setup process, click here for help.I suppose something is not well configured ??
Forum: Fixing WordPress
In reply to: Adding a border to the footerDear pwsupport.
The problem with the header was solved (see https://www.leubner.cz/). The title of the first article was shown above the bottom-border of the header. I have fixed it with the change of the code to:
.site-nav ul li { list-style: none; display: inline; }
I have another problem of the same type now here: https://www.leubner.cz/?page_id=4
The title should not be next to the “PC a internetGrafika Programování” (children links) but because of some float property the position is wrong (it has moved one row higher).
Here is my code with float:
.children-links ul { float:left; } .children-links li { margin-right: 20px; } .children-links .parent-link { float:left; margin-right: 20px; padding-right: 20px; border-right: 1px solid #DDD; font-size: 120%; font-weight: bold; }
How can I repair it?
Thanks
- This reply was modified 7 years, 10 months ago by happik.
One more remark – I don’t know why but I do not have any php.ini file in the installation.