pk-71
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: is_tax() conditional tag not workingThanks Joy. I’ve changed the code to
is_tax('news_categories', 'web')
and this does produce the underline on the ‘Web’ menu item.I’ve also changed the anchor link in menu-item-2 to
is_tax('news_categories', 'graphic-design')
The problem I have now though is the blue underline shows on both menu items when I’m on the ‘web’ term archive page.
Should I to be using a different archive template file? Is there one for terms as well as taxonomies?
Forum: Developing with WordPress
In reply to: Pin the 4th Post On The Archive Page Of A Custom Post TypeHi @bcworkz
Thanks for this. Because I’m building a custom theme from scratch I already have an
archive-{$post_type}.php
file, which isarchive-news.php
. In terms of using theWP_Query()
you mention at the end…I can’t see anywhere in the docs how to do this?Here is a simplified version of how I use the WP query object. I can’t seem to see in the docs though what would go where the first
// CODE GOES HERE
comment to achieve what I wish to achieve?<?php $archivePageNews = new WP_Query(array( // CODE GOES HERE )); while( $archivePageNews->have_posts()){ $archivePageNews->the_post(); ?> <article class="article top-article"> <!-- ARCHIVE POST CONTENT GOES HERE --> </article> <?php } ?> <?php wp_reset_postdata(); ?>
I guess my point is how can you run this plugin with out adding the Google Chrome
loading="lazy"
attribute, so it works as well in chrome as it does in other browsers?Seems to be an odd thing to add into a plugin when this is easy to add into HTML or with some simple javascript. The whole point of this plugin should be to use it as a different solution to the
loading="lazy"
attribute, when you still want images to be be lazy loaded?Please advise.
Hi Keri,
Thanks for the quick reply. The Purchase Limit extension looks perfect – the PDF vouchers one though doesn’t seem to autogenerate numbers on the tickets? I.e. when someone downloads a ticket it is automatically assigned a new number? This isn’t vital though because they’ll be emailed details for their full ticket etc so I’ll probably just do my own PDF in Illustrator.
P
Hi
I found the solution to this – i was using ‘the_excerpt()’ in my page.php file instead of ‘the_content()’ All working now.
Apologies.
Forum: Developing with WordPress
In reply to: Show Custom Post Type Archive by AuthorWow that’s amazing. Thank you so much @bcworkz!
Forum: Developing with WordPress
In reply to: Show Custom Post Type Archive by AuthorHi @bcworkz,
At the moment I do have separate template files for the CPT archive and blog archive, but I don’t understand how I’m supposed to conditionally vary the archive depending on whether the user clicks on the author name in the blog (and thus go to a blog archive) and when the user clicks on the author name in a CPT (and thus send them to a CPT archive).
I can’t seem to find any information on how to achieve this. I’ve included my loop for the archive-cpt.php file below (in this case the file is called archive-job.php). Are you saying i need to apply some conditional logic to where it outputs
<?php the_author_posts_link(); ?>
I would have thought there would be a parameter I could add into the above template tag that was the name of the custom-post-type or something. This is where I’m stuck: in terms of trying to force it to only show CPTs. The blog archive page I can keep as it is, because that by default does only show blog posts. My problem obviously is the template tag
<?php the_author_posts_link(); ?>
also only shows blog posts when used in the archive-job.php file.My loop in the archive-job.php template file is:
<?php while(have_posts()){ the_post(); ?> <div class="row"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="metabox"> <p>Posted by <?php the_author_posts_link(); ?> on, <?php the_time('jS M Y'); ?> | <?php echo get_the_term_list ($post->ID, 'job_type', 'Job Type: ', ', ', ''); ?></p> </div> <div class="generic-content"> <?php the_excerpt(); ?> <a class="btn btn-left" href="<?php the_permalink(); ?>">Continue reading...</a> </div> </div> <?php } ?>
Forum: Fixing WordPress
In reply to: Change default Media URLs now IE8 support has been droppedIt would be nice if everything worked out of the box though. The last 2 sites i’ve moved to https had one or two images that didn’t change to https when i did the standard settings > general change. It wasn’t a disaster – i just re-uploaded them. If all content was the // version it would defo make life easier.
Paul.
Forum: Developing with WordPress
In reply to: Custom Post TypesThat was really useful, thank you so much. I know the research itself and playing around with custom post types is going to be a bit of a journey, but that really helped in terms of the overall concept and terminology.
Forum: Developing with WordPress
In reply to: Custom Post TypesThanks very much for the above.
So when you got to a normal blog page on WP, and you’re faced with a list of posts – is that page known as an archive page? What I’m struggling to understand is what an archive page does? The word archive insinuates old/redundant/not in use anymore, as in when you archive old information.
Thanks Tony.
If you look at my original reply Boris, I do say what you recommended works.
My point is about what happens if you change the user page redirect, whatever your opinion, I just don’t think you should have a dropdown menu for changing the user page that breaks the user’s site. At least have a warning if you know this will happen !!!
I’m using MAMP and I changed the page the user sees after login to the homepage because this is where the content redirects are going to be on the site at the client’s request (i.e links to relevant articles etc).
I did UM > Settings > User Page and changed the drop down option to the home page.
Then the sky fell in.
When I removed the plugin it also removed my homepage ??
Obviously I know now going forward not to do this, but perhaps it should be made clearer for others in the future. Also if redirecting the user to the homepage is such a bad thing to do, why do you have it as an option in the dropdown menu? It would take a relatively simple if / else statement to remove the front page from those options?
I did not misinterpret the instructions at all, I mentioned that I would like it to go to a page such as my homepage in my initial question.
Neither yourself, nor that article, makes you aware of the dangers of using your homepage/front page as a re-direct page for users.
I am just grateful it was a localhost site and not a live site because it also deleted my front page entirely when I removed the plugin.
I suggest you amend or replace that original article so it makes users aware of the dangers of what happens if they do this.
Just to let you that did work, but if you change the user page default re-direct to the site’s homepage it breaks the entire site.
THIS IS VERY VERY BAD !!!