lgehrig4
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Gutenberg Image Block Crops Half of ImageThank you. Ended up resizing the image. I thought WordPress would automatically resize to fit
Forum: Themes and Templates
In reply to: [Phlox] Need Help Locating Where Link Is EnqueuedI pasted this in the child theme’s function.php file and when I tried to save it I got this error:
Your PHP code changes were rolled back due to an error on line 55 of file wp-content/themes/phlox-child/functions.php. Please fix and try saving again.
Cannot redeclare wp_dequeue_style() (previously declared in wp-includes/functions.wp-styles.php:195)
Forum: Fixing WordPress
In reply to: ERROR: Uncaught TypeError: Cannot read property ‘value’ of undefinedThank you for the great questions and suggestions. They’ve had a lot of hands in the pot over the years building this and I only do what they ask so I’m not sure of the “whys”
I removed all the @font-face rules form the child theme CSS file but noticed that this link is being enqueued from somewhere, but I’m not sure how to find out where.
<link rel='stylesheet' id='google-fonts-1-css' href='https://fonts.googleapis.com/css?family=Poppins%3A100%2C100italic%2C200%2C200italic%2C300%2C300italic%2C400%2C400italic%2C500%2C500italic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic%2C900%2C900italic%7CGochi+Hand%3A100%2C100italic%2C200%2C200italic%2C300%2C300italic%2C400%2C400italic%2C500%2C500italic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic%2C900%2C900italic%7CLato%3A100%2C100italic%2C200%2C200italic%2C300%2C300italic%2C400%2C400italic%2C500%2C500italic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic%2C900%2C900italic&display=auto&ver=5.8' type='text/css' media='all' />
Just for the heck of it I enqueued my own version in the child theme’s functions.php just to see ho it would show in the head and these 2 new links were created.
<link rel='dns-prefetch' href='//fonts.googleapis.com' />
<link rel='stylesheet' id='add_google_fonts-css' href='https://fonts.googleapis.com/css2?family=Poppins%3Aital%2Cwght%400%2C200%3B0%2C300%3B0%2C400%3B0%2C500%3B0%2C600%3B0%2C700%3B0%2C800%3B0%2C900%3B1%2C200%3B1%2C300%3B1%2C400%3B1%2C500%3B1%2C600%3B1%2C700%3B1%2C800%3B1%2C900&display=swap%22+rel%3D%22stylesheet&ver=5.8' type='text/css' media='all' />
The first one is loading more fonts that the site uses. How can I locate where that is being enqueued?
As far as the Youtube embeds, the administrators have been using Elementor to build pages. They use the video widget and paste in the direct link from the video.
I’ll move on to the rest once I can get these sorted.
Thanks again!
Forum: Developing with WordPress
In reply to: How to retrieve post image url?That was it thank you. I thought adding it to the post would attach it.
Forum: Developing with WordPress
In reply to: How to retrieve post image url?Below my post paragraph I selected an image block and uploaded an image. How would this constitute not having an attachment? Not following.
I read that page (thank you) but I’m not skilled enough at the moment to figure this out using that information.
Forum: Developing with WordPress
In reply to: front-page.php coming up blankNevermind. I understand now. This is why I’m doing this in the first place. I figured if I could somehow deconstruct a tried and true theme that is much more complex that anything I’d done, that I would learn a thing or two….that I have
Forum: Developing with WordPress
In reply to: front-page.php coming up blank@dd32 Thank you. Got it fixed, but I can’t say for sure what the exact issue was. I’ve basically copied the twentynineteen theme and part of the twentyseventeen theme to use for the structure. I’ve removed a bunch of files, functions and code that I will not be using, but apparently there were a coupe functions that I had not gotten to yet that were blocking the template from loading when the homepage was set to static. I don’t know which it was but after delete all I wasn’t going to use, the template loaded.
The problem now is that the posts don’t load from this template the way they did when it was not set to static. Only the title and content from the page displays. This is the code.
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_sticky() && is_home() && ! is_paged() ) { printf( '<span class="sticky-post">%s</span>', _x( 'Featured', 'post', 'wordpressboilerplate' ) ); } if ( is_singular() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); endif; ?> </header><!-- .entry-header --> <div class="entry-image"> <?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail('medium'); ?> </a> <?php endif; ?> </div> <div class="entry-content"> <?php the_content( sprintf( wp_kses( /* translators: %s: Post title. Only visible to screen readers. */ __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'wordpressboilerplate' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'wordpressboilerplate' ), 'after' => '</div>', ) ); ?> </div><!-- .entry-content --> </article><!-- #post-<?php the_ID(); ?> -->
Forum: Developing with WordPress
In reply to: Production Site different than Dev site?Thank you for the information. You’re correct that I didn’t remove callback.
I don’t know if it’s just me but I’m finding that learning WordPress, beyond the basics, of more difficult than anything I’ve taught myself so far (HTML, CSS, Javascript, React, Node). It feels as though you cant learn the traditional way (videos & books). You just have to start trying building something and learn from each problem that arises. Perhaps I haven’t come across the right course yet?
Forum: Developing with WordPress
In reply to: Production Site different than Dev site?Figured it out but I’d still love to know why it happened. The project post images were wrapped in a <p> tag (not by me) but the localhost images did not. I’m referring to the source code.
Heres what was entered into the production admin panel, which was exactly the same as the local admin aside from the image urls. When I inspected these, all three images were wrapped in a <p> tag on the product site, which threw off the CSS. Why wouldn’t it be the same as the dev site?
<div> <div class="single-project-content__images"> <img src="https://www.sdigitaldesign.com/wp-content/uploads/2020/10/tbb2-300x188.png" alt="Travel Blogger Website" width="300" height="188" class="alignnone size-medium wp-image-116" /> <img src="https://www.sdigitaldesign.com/wp-content/uploads/2020/10/tbb3-300x188.png" alt="Travel Blogger Website" width="300" height="188" class="alignnone size-medium wp-image-117" /> <img src="https://www.sdigitaldesign.com/wp-content/uploads/2020/10/tbb7-300x188.png" alt="Travel Blogger Website" width="300" height="188" class="alignnone size-medium wp-image-118" /> </div> Lorem, ipsum dolor sit amet consectetur adipisicing elit. Odio mollitia, aut perferendis dolor repellendus et asperiores quisquam minus nostrum atque, fugiat tenetur ipsum repellat eaque tempora excepturi laboriosam recusandae fugit doloremque cupiditate, rem porro iusto! Deleniti in praesentium qui aliquid itaque, ipsa dolore eos adipisci quo dolores et nulla provident inventore maiores voluptas impedit rem architecto minus, possimus quos blanditiis! </div>
Forum: Developing with WordPress
In reply to: External Link in Custom Post TypeYou are correct in that it’s for my own learning experience. I’m changing careers from finance to web dev and this site will be aimed to both potential clients and employers. Will definitely go the route that makes most sense and is most efficient when doing this for others.
Forum: Developing with WordPress
In reply to: External Link in Custom Post TypeThank you. I’m not sure how answer your question other than explain what I am doing. The custom theme I am making is for my personal website and portfolio. The custom posts will be websites that I made, but not all will be in production. For the ones that are I want to have a link that takes you to the live site.
So, when creating each portfolio post in the admin panel I’d like to have a field where I can enter the url that the php code grabs dynamically.
I think I’m answering the question correctly when i say that the button itself will be in the php template, but the url it grabs will be from the content that I entered in the admin panel.
Based on this which of the methods you described would be the best route? Not easiest, but best.
correction: I mean to write “hard coded” above
Thank you. I had gone through the docs but was never able to make anything from it work.
This is the answer, but for some reason the examples of this in the docs have a coded number. Why would you ever use a hard coded number?
$args = array( 'status' => 'approve', 'post_id'=> get_the_ID() );
Here are three examples of what I am referring to. I’ve never seen a post with comments from another post yet not one of these examples shows how to get comments for the selected post. What am I missing?
$args = array( 'post_id' => 1, // Use post_id, not post_ID 'count' => true // Return only the count ); $comments_count = get_comments( $args ); echo $comments_count;
$comments = get_comments( array( 'post_id' => 15 ) ); foreach ( $comments as $comment ) : echo $comment->comment_author; endforeach;
$args = array( 'status' => 'hold', 'number' => '5', 'post_id' => 1, // use post_id, not post_ID ); $comments = get_comments( $args ); foreach ( $comments as $comment ) : echo $comment->comment_author . '<br />' . $comment->comment_content; endforeach;
Forum: Developing with WordPress
In reply to: Adding share link button in Invividual postFound this and wanted to post for anyone else looking to do the same
Forum: Developing with WordPress
In reply to: Adding share link button in Invividual postDisregard that link I posted above. Didn’t realize it was wordpress.com