universaltruth
Forum Replies Created
-
Thank you for your help. It works great!
I spent hours on this problem. Your solution saved me spending more time. You should get paid for helping others.
- This reply was modified 7 years, 8 months ago by universaltruth.
Thanks. I’ve tried something similar to the following and it worked for very simple text.
$referalString = “**** Adsense code will go here ****”;
add_filter(‘the_content’, ‘linkAppend’);function linkAppend($content) {
global $referalString;
$content = preg_replace(‘<div class=”question”>….</div>’, $referalString, $content);
return $content;
}Do you know the pattern matching syntax I would need to find the following line of code and then place the adsense code after it. Only the text “Question under main title goes here” will vary:
<div class=”question”>Question under main title goes here</div>
You said:
More primitive searching might be more efficient.
Do you have any idea of how I could carry out more primitive searching?
Thanks
If anyone could just let me know whether this effect is even possible without adding code or some other ad on to the plugin that would be great. It would save me a lot of time
Forum: Fixing WordPress
In reply to: Multiple wordpress installations on one site for PortfolioI wanted to have mydomain.com as the root for my own site and the other wordpress sites with the same root but in different directories. For example mydomain.com/portfolio/website1, mydomain.com/portfolio/website2, mydomain.com/portfolio/website3
Each would have it’s own blog installation with it’s own theme and functionality. Is this possible?
Forum: Fixing WordPress
In reply to: Multiple wordpress installations on one site for PortfolioI was thinking that maybe adding another wordpress site to the same site will cause problems, then again if they are in separate directories wont they be separate from one another?
Forum: Fixing WordPress
In reply to: How do I create a UNIQUE KEY when creating wpdb tableThanks for your help! I didn’t realize you could create a table manually using PHPmyadmin. I thought you had to enter an SQL query. This is very helpful to know for the future.
It appears I needed to add a Grave accent( ` ) around each column name. I don’t know why this should be the case since they don’t appear in any of the WP codex examples.
I exported query code and added it to the PHP code and it seems to be working.
Forum: Fixing WordPress
In reply to: How do I create a UNIQUE KEY when creating wpdb tableUnfortunately nothing works when running the query in phpmyadmin, even the old query which worked in the PHP code.
Forum: Fixing WordPress
In reply to: How do I create a UNIQUE KEY when creating wpdb tableThe problem is I can’t get it working using either method. I will worry about how to export the table once I get it working.
All I did was add an extra line of code and the table is no longer created when I activate the plugin. This is the line that causes the query to no longer work:
UNIQUE KEY lastname (lastname)
Forum: Fixing WordPress
In reply to: How do I create a UNIQUE KEY when creating wpdb tableI’ve tried adjusting the code. I just get one error after another. Where are you entering the code and what code are you entering exactly? Do you enter the coe under the SQL tab or under the Query tab in PHPmyadmin
Forum: Fixing WordPress
In reply to: How do I create a UNIQUE KEY when creating wpdb tableThanks for your response. However changing firstname and lastname to VARCHAR makes no difference. As for not making firtname or lastname UNIQUE I would agree. I will probably make the Email unique instead. However this is just a test:
Here is my updated code. See if you can find the mistake:
global $jal_db_version; $jal_db_version = '1.0'; function jal_install() { global $wpdb; global $jal_db_version; $table_name = $wpdb->prefix . 'simons_table'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE $table_name ( id mediumint(9) NOT NULL AUTO_INCREMENT, time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, firstname VARCHAR NOT NULL, lastname VARCHAR NOT NULL, description text NOT NULL, url varchar(55) DEFAULT '' NOT NULL, UNIQUE KEY id (id), UNIQUE KEY lastname (lastname) ) $charset_collate;"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); dbDelta( $sql ); add_option( 'jal_db_version', $jal_db_version ); } function jal_install_data() { global $wpdb; $welcome_name = 'Mr. WordPress'; $welcome_text = 'Congratulations, you just completed the installation!'; $table_name = $wpdb->prefix . 'simons_table'; $wpdb->insert( $table_name, array( 'time' => current_time( 'mysql' ), 'name' => $welcome_name, 'text' => $welcome_text, ) ); } register_activation_hook( __FILE__, 'jal_install' ); register_activation_hook( __FILE__, 'jal_install_data' );
Forum: Fixing WordPress
In reply to: Cannot place text or image directly under another image.I was able to remove more of the space below the image by setting the line-height of the text button to 0px . However it would be nice to remove all the space below the image just to determine what is causing it.
Forum: Fixing WordPress
In reply to: Cannot place text or image directly under another image.I was able remove some of the space under the image by remvoing a break tag. However I would like to remove all the space.
I think i need to target the img element. How do I remove the gap at the bottom of each image I place into the wordpress page (see below for example):
<img class="aligncenter size-full wp-image-225" alt="John Roberts Business card" src="https://www.wordhook.com/wp-content/uploads/2014/04/240196976591121052-s.jpg" width="310" height="120">
Forum: Fixing WordPress
In reply to: Cannot place text or image directly under another image.Does anyone know what element is causing the space under the image. If I knew I could target the element in the custom css style sheet.
This is driving me nuts. I have Akismet installed and active. It tells me that “Akismet is enabled and the key is valid. This form will be checked with Akismet to help prevent spam”.
I have set Fast Secure Contact Form Options to “block spam messages” for Akismet.
I still get about 20 spam messages a day. Akismet is not blocking anything even though it is active. Changing the settings doesn’t seem to make any difference.
I’ve noticed the spam messages tend to just be gibberish but not allways. Im going to try changing some other settings and let you know if i can stop this.
I liked using Fast Secure Contact Form but thinking of changing to a different plugin.
Forum: Plugins
In reply to: [Yoast SEO] [Plugin: WordPress SEO by Yoast] xml sitemap is creating an errorI have the same problem. It appears to be some kind of injection of code from a hacker. However I have no idea how to remove it and what else has been compromised. I’ve tried deactivating plugins and that has not resolved the problem.