WPOso
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Where is header img width defined?Thanks.
Forum: Fixing WordPress
In reply to: Creating header specific to home pageSorry, I forgot to add that I’m using the theme twenty seventeen.
Forum: Fixing WordPress
In reply to: Unwanted CommentsWeird; I checked to see if I had already posted, but I didn’t see any post at all, so I figured it had been rejected.
Anyway, I think I am using Aksismet. I’ll check out WordPress Zero Span. Thanks.
Forum: Fixing WordPress
In reply to: Adding PollsGood tips; thanks.
Forum: Fixing WordPress
In reply to: Excluding wp-admin folder from statisticsThanks for the tips. I didn’t even know my WordPress site used AJAX.
Forum: Fixing WordPress
In reply to: How should I include this PHP file?Thanks, I’ll check those out.
Forum: Fixing WordPress
In reply to: How should I include this PHP file?I found a couple custom fields plugins. Can you list any plugins that help you include PHP files? Thanks.
Forum: Fixing WordPress
In reply to: How should I include this PHP file?Actually, this turned into two problems, one of which I just solved. As you suggested, I created a new folder – mu-plugins – put my file inside it, and it does autoload.
However, I still need to know how to write includes.
The file inside my mu-plugins folder is fine for creating echo values, but if I want to actually display something at the beginning of an article or at the bottom of the page, then I need to be able to insert an include in the proper location.
Also, I’m eventually going to put some database-driven reference tables on some of my pages, so I’ll have to include separate files that feature queries and a lot of styling, etc.
Anyway, what’s the proper way to write an include?
Forum: Fixing WordPress
In reply to: Including Custom FileThanks.
Forum: Fixing WordPress
In reply to: Including Custom FileThat will vary. On the county pages, the post content will probably consist entirely of a block of text defined in an include.
In other cases, I may make posts that look like this…
This is an article about a species of antelope, the impala.
$Info
Impala are popular symbols.$Info could then be replaced by something I want to display on all antelope pages.
In other cases, there might be a block of text that I want to display at the end of every article. It’s really all over the map.
EDIT:
It would probably make sense to include TWO files, one before my post content and the other at the end.
The first could be used to 1) display images or content that I want to display before my post and 2) define PHP variables that I want to echo in the body of my post. The second would then display items I want to display at the end of the post, such as links to related articles.
Forum: Fixing WordPress
In reply to: Including Custom FileIt will probably have a series of echo values and PHP switches. For example…
$CountyIntro = 'If you live in '.$MyCounty.', we want to hear from you.'
Then I could paste $CountryIntro into a post and use str_replace(‘$CountyIntro’, $CountyIntro, $Article)
Or I could create a switch based on URL’s:
switch($MyURL) { case 'adams-country': echo $CountyIntro; break; default: break; }
The file could also feature includes to additional include files as needed.
Forum: Fixing WordPress
In reply to: Displaying Custom FieldOK, I copied functions.php into my child theme folder, added that code and uploaded, but the page still displays nothing.
I think the problem is it isn’t “connecting” with my custom field. The name of the custom field was “County Intro.” I just changed it to “county,” but it still doesn’t work.
Forum: Fixing WordPress
In reply to: Displaying Custom FieldOK, the shorcode page offers the following example:
//[foobar] function foobar_func( $atts ){ return "foo and bar"; } add_shortcode( 'foobar', 'foobar_func' );
If my custom field is titled “County Intro,” then how would I modify that? Something like this?:
//[foobar] function foobar_func( $atts ){ return "County Intro"; } add_shortcode( 'foobar', 'foobar_func' );
Also, I don’t see where they explain WHERE to paste the code.
Forum: Fixing WordPress
In reply to: PHP Includes 101Thanks.
Forum: Fixing WordPress
In reply to: Inserting a LOCAL VideoThanks.